| Author |
Message |
djdiz-e Regular


Joined: Dec 19, 2004 Posts: 51 Location: Ontario, Canada
|
Posted:
Fri Apr 22, 2005 5:37 pm |
|
heres what i did to get this to work
now my forum profiles are gone and replaced with CNBYA Profiles ...YAY:)
EDIT: modules/forums/profile.php
FIND:
| Code: | if ( $mode == 'viewprofile' )
{
include("includes/usercp_viewprofile.php");
exit;
}
else if ( $mode == 'editprofile' || $mode == 'register' )
{
if ( !$userdata['session_logged_in'] && $mode == 'editprofile' )
{
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", $_SERVER["SERVER_SOFTWARE"]) ) ? "Refresh: 0; URL=" : "Location: ";
header($header_location . append_sid("login.$phpEx?redirect=profile.$phpEx&mode=editprofile", true));
exit;
}
include("includes/usercp_register.php");
exit;
} |
REPLACE WITH:
in the first line that starts with header remove one ? from modules.php??
had to do that so this site will show it correctly
| Code: | if ( $mode == 'viewprofile' )
{
$sql = "SELECT username FROM ".$prefix."_users WHERE user_id = $u";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$un = $row[username];
}
Header("Refresh: 0; url=modules.php??name=Your_Account&op=userinfo&username=$un");
}
else if ( $mode == 'editprofile' )
{
Header("Refresh: 0; url=modules.php?name=Your_Account&op=edituser");
} |
|
|
|
|
 |
menelaos61 Worker


Joined: Nov 10, 2004 Posts: 110
|
Posted:
Sun Apr 24, 2005 4:17 pm |
|
Nice  |
|
|
|
 |
djdiz-e Regular


Joined: Dec 19, 2004 Posts: 51 Location: Ontario, Canada
|
Posted:
Sun Apr 24, 2005 10:00 pm |
|
thanks i was looking everywhere for somthing to do it then i started messing with it and came up with this ...short and sweet and does the job  |
|
|
|
 |
64bitguy The Mouse Is Extension Of Arm

Joined: Mar 06, 2004 Posts: 1140 Location: Manchester, NH USA
|
Posted:
Wed Apr 27, 2005 10:16 am |
|
Unfortunately, there is a downside relative to this relating to Signature managment and fields that don't yet exist in CNB_YA that do exist in Profile.
Presently, CNB_YA uses Profile functions to manage some signatures (something that really bothers me).
Over time, signature fixes have been worked out of nuke and into the profile function which is very problematic. In fact, you'll notice that CNB_YA relies on Profile exclusively for this function and if you are using dynamic or graphic signatures, you can forget about having CNB_YA handling it correctly, it must be done via profile.
Thus, you should keep that in mind.
I'm of the mind and heart to eliminate profile as well, but with the understanding that some functions really rely on Profile. Also, as CNB_YA has yet to incorporate ALL of the profile fields into CNB_YA, it may still be necessary for people ot have access to profile to fill in or to view that information.
In my case, I use GoogleTap, thus I was able to simply change the redirect rules there instead of having to modify core code to force YA for some functions, but I do leave profile available for others until these issues can be addressed in future CNB_YA versions.
Just a heads-up!
Steph |
|
|
|
 |
djdiz-e Regular


Joined: Dec 19, 2004 Posts: 51 Location: Ontario, Canada
|
Posted:
Wed Apr 27, 2005 5:35 pm |
|
ya i noted that the signature dont work very well in cnbya for adding an image
but if you have no added fields in the forum profiles you could use this code to view CNB YA profiles and forums profile edit still works
FIND:
| Code: | if ( $mode == 'viewprofile' )
{
include("includes/usercp_viewprofile.php");
exit;
|
REPLACE WITH:
in the first line that starts with header remove one ? from modules.php??
had to do that so this site will show it correctly
| Code: | if ( $mode == 'viewprofile' )
{
$sql = "SELECT username FROM ".$prefix."_users WHERE user_id = $u";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$un = $row[username];
}
Header("Refresh: 0; url=modules.php??name=Your_Account&op=userinfo&username=$un");
|
|
|
|
|
 |
ashishjha54 Hangin' Around

Joined: Jan 24, 2005 Posts: 41
|
Posted:
Sun May 08, 2005 7:33 pm |
|
hello, is there a way to replace CNBYA profile with forum profiles.
thanks |
|
|
|
 |
djdiz-e Regular


Joined: Dec 19, 2004 Posts: 51 Location: Ontario, Canada
|
Posted:
Sun May 08, 2005 10:34 pm |
|
if you did the YA profile hack above make sure you remove it before doing this
EDIT: modules/Your_Account/public/userinfo.php
FIND:
| Code: |
$result = $db->sql_query("SELECT * FROM ".$user_prefix."_users WHERE username='$username'");
$num = $db->sql_numrows($result);
$usrinfo = $db->sql_fetchrow($result);
|
ADD THIS BELOW IT:
(remove 1 ? from modules.php??)
| Code: |
Header("Location: modules.php??name=Forums&file=profile&mode=viewprofile&u=$usrinfo[user_id]");
|
|
Last edited by djdiz-e on Mon May 09, 2005 2:26 pm; edited 1 time in total |
|
|
 |
ashishjha54 Hangin' Around

Joined: Jan 24, 2005 Posts: 41
|
Posted:
Mon May 09, 2005 10:05 am |
|
i understood that i have to add
| Code: |
Header("Location: modules.php??name=Forums&file=profile&mode=viewprofile&u=$usrinfo[user_id]"); |
after
| Code: |
$result = $db->sql_query("SELECT * FROM ".$user_prefix."_users WHERE username='$username'");
$num = $db->sql_numrows($result);
$usrinfo = $db->sql_fetchrow($result);
|
in public/userinfo.php file,but could not understand this line.
| Code: |
(remove 1 & from modules.php??)
|
can you explain it.
thanks. |
|
|
|
 |
djdiz-e Regular


Joined: Dec 19, 2004 Posts: 51 Location: Ontario, Canada
|
Posted:
Mon May 09, 2005 2:26 pm |
|
sorry i mean remove 1 ? from that line
so it will be modules.php?
if i post it as it should be this site will display it as
Header("Location: profile-.html$usrinfo[user_id]");
witch is incorrect |
|
|
|
 |
ashishjha54 Hangin' Around

Joined: Jan 24, 2005 Posts: 41
|
Posted:
Mon May 09, 2005 6:25 pm |
|
i did it but the following errors come.
| Code: |
Fatal error: Cannot redeclare replace_for_mod_rewrite() (previously declared in C:\Program Files\Apache Group\Apache2\htdocs\header.php:10) in C:\Program Files\Apache Group\Apache2\htdocs\header.php on line 10
|
|
|
|
|
 |
ashishjha54 Hangin' Around

Joined: Jan 24, 2005 Posts: 41
|
Posted:
Mon May 09, 2005 7:04 pm |
|
sorry the above problem was just because i was trying to make a forum hack.
it works well.
i have another question.
is it possible to replace all CNBya userinfo url with froum viewprofile url.i.e.
| Code: |
modules.php??name=Your_Account&op=userinfo&username=username
|
with corresponding forum url
| Code: |
modules.php??name=Forums&file=profile&mode=viewprofile&u=$usrinfo[user_id]
|
|
|
|
|
 |
djdiz-e Regular


Joined: Dec 19, 2004 Posts: 51 Location: Ontario, Canada
|
Posted:
Mon May 09, 2005 7:38 pm |
|
it is but you have to edit every file that points to the YA profiles
so if you have a user info block that points to the YA profile u will need to edit the file block-User_Info.php in the blocks folder and change the line
modules.php??name=Your_Account&op=userinfo&username=??
..this way it makes it really easy to make it work  |
|
|
|
 |
ashishjha54 Hangin' Around

Joined: Jan 24, 2005 Posts: 41
|
Posted:
Mon May 09, 2005 8:13 pm |
|
now when i login ,after installing your hack, i am redirected to forums profile.is there a way so that when you login you are rediected CNBYA profile instead of forum profile.and when other user tries to view your profile then they are redirected to forum profile. |
|
|
|
 |
djdiz-e Regular


Joined: Dec 19, 2004 Posts: 51 Location: Ontario, Canada
|
Posted:
Mon May 09, 2005 9:48 pm |
|
FIND:
| Code: | $result = $db->sql_query("SELECT * FROM ".$user_prefix."_users WHERE username='$username'");
$num = $db->sql_numrows($result);
$usrinfo = $db->sql_fetchrow($result); |
ADD THIS BELOW:
| Code: |
cookiedecode($user);
$check = $cookie[1];
if(!$usrinfo[username] == "$check") {
Header("Location: modules.php??name=Forums&file=profile&mode=viewprofile&u=$usrinfo[user_id]");
} |
IF YOU GOT THIS REPLACE IT WITH ABOVE CODE:
| Code: | | Header("Location: modules.php??name=Forums&file=profile&mode=viewprofile&u=$usrinfo[user_id]"); |
|
|
|
|
 |
version New Member


Joined: May 06, 2005 Posts: 8
|
Posted:
Tue May 10, 2005 6:50 am |
|
Going back to the original post, ive replaced the code and removed the extra'?' but now I get a std ie page saying 'this page cannot be displayed'.
When i hover my mouse over a members name in the forums the link still shows
Im using 7.6 platinum if that helps |
|
|
|
 |
ashishjha54 Hangin' Around

Joined: Jan 24, 2005 Posts: 41
|
Posted:
Tue May 10, 2005 10:55 am |
|
| Code: |
cookiedecode($user);
$check = $cookie[1];
if(!$usrinfo[username] == "$check") {
Header("Location: modules.php??name=Forums&file=profile&mode=viewprofile&u=$usrinfo[user_id]");
}
|
this code was not working so i changed it to
| Code: |
cookiedecode($user);
$check = $cookie[1];
if($usrinfo[username] != "$check") {
Header("Location: modules.php??name=Forums&file=profile&mode=viewprofile&u=$usrinfo[user_id]");
}
|
|
|
|
|
 |
version New Member


Joined: May 06, 2005 Posts: 8
|
Posted:
Tue May 10, 2005 10:59 am |
|
| version wrote: | Going back to the original post, ive replaced the code and removed the extra'?' but now I get a std ie page saying 'this page cannot be displayed'.
When i hover my mouse over a members name in the forums the link still shows
Im using 7.6 platinum if that helps |
Anyone |
|
|
|
 |
ashishjha54 Hangin' Around

Joined: Jan 24, 2005 Posts: 41
|
Posted:
Tue May 10, 2005 11:10 am |
|
do as per djdiz-e has instructed.he is a great programmer .i want to thank him for the trick he has given me.
Thank you djdiz-e.
can you tell me when i login into my account i get the following code for signature.is it possible that i get the original signature in place of this codein userinfo.
[img:0764663e7b]http://www.yahoo.com/images/sig/ash.gif[/img:0764663e7b][img:0764663e7b]http://www.yahoo.com/images/sig/ashleh.gif[/img:0764663e7b] |
|
|
|
 |
djdiz-e Regular


Joined: Dec 19, 2004 Posts: 51 Location: Ontario, Canada
|
Posted:
Tue May 10, 2005 11:20 am |
|
where do you see 'this page cannot be displayed'?
is it when you click the username to see the user info? |
|
|
|
 |
version New Member


Joined: May 06, 2005 Posts: 8
|
Posted:
Tue May 10, 2005 11:22 am |
|
yes, exactly that.
Thanks for reply |
|
|
|
 |
djdiz-e Regular


Joined: Dec 19, 2004 Posts: 51 Location: Ontario, Canada
|
Posted:
Tue May 10, 2005 11:26 am |
|
[img:0764663e7b]?? is what YA puts there when you use the [IMG]???[/IMG] code in your signature in the edit forum profile,YA dosent seem to handle images in the signatures if you try to add them in the YA edit profile page ..not sure a way around it havent looked into it i think thats going to be fixed in the next version
maybe someone else has more info on this? |
|
|
|
 |
djdiz-e Regular


Joined: Dec 19, 2004 Posts: 51 Location: Ontario, Canada
|
Posted:
Tue May 10, 2005 11:27 am |
|
can you post you web address for me to see?
or maybe pm it if you like |
|
|
|
 |
djdiz-e Regular


Joined: Dec 19, 2004 Posts: 51 Location: Ontario, Canada
|
Posted:
Wed May 11, 2005 5:47 pm |
|
if the above dont work you might wanna try this:
FIND:
| Code: | if ( $mode == 'viewprofile' )
{
include("includes/usercp_viewprofile.php");
exit;
}
else if ( $mode == 'editprofile' || $mode == 'register' )
{
if ( !$userdata['session_logged_in'] && $mode == 'editprofile' )
{
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", $_SERVER["SERVER_SOFTWARE"]) ) ? "Refresh: 0; URL=" : "Location: ";
header($header_location . append_sid("login.$phpEx?redirect=profile.$phpEx&mode=editprofile", true));
exit;
}
include("includes/usercp_register.php");
exit;
} |
REPLACE WITH THIS:
remove one ? mark from Header("Location: modules.php??
| Code: | if ( $mode == 'viewprofile' ) {
$profiledata = get_userdata(intval($HTTP_GET_VARS[POST_USERS_URL]));
$u = $profiledata['user_id'];
$sql = "SELECT username FROM ".$prefix."_users WHERE user_id = $u";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$un = $row[username];
}
Header("Location: modules.php??name=Your_Account&op=userinfo&username=$un");
exit;
}
else if ( $mode == 'editprofile' )
{
Header("Location: modules.php?name=Your_Account&op=edituser");
exit;
} |
|
|
|
|
 |
djdiz-e Regular


Joined: Dec 19, 2004 Posts: 51 Location: Ontario, Canada
|
Posted:
Thu Jun 09, 2005 7:17 pm |
|
menelaos should add this YA Hack to the new version
maybe add a option to select profiles to use in the config for CNB YA
i can write up alittle script for it if you like  |
|
|
|
 |
djdiz-e Regular


Joined: Dec 19, 2004 Posts: 51 Location: Ontario, Canada
|
Posted:
Fri Aug 26, 2005 6:10 pm |
|
i also added a photo upload to the your account section
registration required to view photo
|
|
|
|
 |
|
|
|
|