Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> CNB Your Account
Author Message
djdiz-e
Regular
Regular



Joined: Dec 19, 2004
Posts: 51
Location: Ontario, Canada

PostPosted: Fri Apr 22, 2005 5:37 pm Reply with quote

heres what i did to get this to work Smile
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");
}
 
View user's profile Send private message Send e-mail Visit poster's website
menelaos61
Worker
Worker



Joined: Nov 10, 2004
Posts: 110

PostPosted: Sun Apr 24, 2005 4:17 pm Reply with quote

Nice Smile
 
View user's profile Send private message Send e-mail
djdiz-e







PostPosted: Sun Apr 24, 2005 10:00 pm Reply with quote

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 Razz
 
64bitguy
The Mouse Is Extension Of Arm



Joined: Mar 06, 2004
Posts: 1164

PostPosted: Wed Apr 27, 2005 10:16 am Reply with quote

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

_________________
Steph Benoit
100% Section 508 and W3C HTML5 and CSS Compliant (Truly) Code, because I love compliance. 
View user's profile Send private message
djdiz-e







PostPosted: Wed Apr 27, 2005 5:35 pm Reply with quote

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

PostPosted: Sun May 08, 2005 7:33 pm Reply with quote

hello, is there a way to replace CNBYA profile with forum profiles.
thanks
 
View user's profile Send private message
djdiz-e







PostPosted: Sun May 08, 2005 10:34 pm Reply with quote

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







PostPosted: Mon May 09, 2005 10:05 am Reply with quote

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







PostPosted: Mon May 09, 2005 2:26 pm Reply with quote

sorry i mean remove 1 ? from that line Smile
so it will be modules.php?

if i post it as it should be this site will display it as

Header("Location: forum-userprofile-.html$usrinfo[user_id]");

witch is incorrect
 
ashishjha54







PostPosted: Mon May 09, 2005 6:25 pm Reply with quote

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







PostPosted: Mon May 09, 2005 7:04 pm Reply with quote

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







PostPosted: Mon May 09, 2005 7:38 pm Reply with quote

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 Smile
 
ashishjha54







PostPosted: Mon May 09, 2005 8:13 pm Reply with quote

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







PostPosted: Mon May 09, 2005 9:48 pm Reply with quote

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
New Member



Joined: May 06, 2005
Posts: 8

PostPosted: Tue May 10, 2005 6:50 am Reply with quote

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
http://*******.***/modules.php?name=Forums&file=profile&mode=viewprofile&u=2

Im using 7.6 platinum if that helps
 
View user's profile Send private message
ashishjha54







PostPosted: Tue May 10, 2005 10:55 am Reply with quote

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







PostPosted: Tue May 10, 2005 10:59 am Reply with quote

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
http://*******.***/modules.php?name=Forums&file=profile&mode=viewprofile&u=2

Im using 7.6 platinum if that helps


Anyone
 
ashishjha54







PostPosted: Tue May 10, 2005 11:10 am Reply with quote

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







PostPosted: Tue May 10, 2005 11:20 am Reply with quote

where do you see 'this page cannot be displayed'?
is it when you click the username to see the user info?
 
version







PostPosted: Tue May 10, 2005 11:22 am Reply with quote

yes, exactly that.

Thanks for reply
 
djdiz-e







PostPosted: Tue May 10, 2005 11:26 am Reply with quote

[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







PostPosted: Tue May 10, 2005 11:27 am Reply with quote

can you post you web address for me to see?
or maybe pm it if you like
 
djdiz-e







PostPosted: Wed May 11, 2005 5:47 pm Reply with quote

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







PostPosted: Thu Jun 09, 2005 7:17 pm Reply with quote

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 Smile
 
djdiz-e







PostPosted: Fri Aug 26, 2005 6:10 pm Reply with quote

i also added a photo upload to the your account section

registration required to view photo
Only registered users can see links on this board! Get registered or login!
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> CNB Your Account

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©