Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Bug Fixes
Author Message
sak
Worker
Worker



Joined: Jul 06, 2005
Posts: 172

PostPosted: Fri Sep 02, 2005 2:39 am Reply with quote

I seem to be having a very odd problem on my site. When I post news stories, the link of my username "Posted by SAK on Friday, September 02 @ 00:53:14 EDT (0 reads)" for example goes to my website's main URL instead of my nuke user profile or even my email. I haven't been able to figure out why it's doing this, I've checked, and double checked, and triple checked all settings. It even does it when I remove my domain from all of the nuke admin prefs, profiles, forums config, etc.

It just insists on creating hyperlinks to my site instead of my profile Sad

I'm running nuke 7.6 patched, NSN Groups installed, and very little else modified. I tried searching for this issue on the forums, but couldn't seem to see it. Thanks, any help is much appreciated.
 
View user's profile Send private message Visit poster's website
hitwalker
Sells PC To Pay For Divorce



Joined:
Posts: 5661

PostPosted: Fri Sep 02, 2005 4:06 am Reply with quote

wel usualy we click a link to the website in question but a link is missing..
 
View user's profile Send private message
Steptoe
Involved
Involved



Joined: Oct 09, 2004
Posts: 293

PostPosted: Fri Sep 02, 2005 1:38 pm Reply with quote

Link to uesr name in news....I have removed these links, including those in user info, and working on removing them in forums unless logged on
Reasoning:
1/ provides a little more privacy to members
2/having too many links is not search engine friendly

The following code is in my folder full of 'note' copy pasted over time from interesting posts I come across. It works, ?Im not a coder so dont know how it works and cant rem who where it was posted.
This is done in themes/YourTheme/theme.php. the following example is from the DeepBlue theme but the method will be similar for other themes.
I think the change u are looking for will be in here somewhere.

Code:
In themes/DeepBlue/theme.php find in the themeindex() function: 

Code:
   ."<font class=\"tiny\">"._POSTEDBY." ";
    formatAidHeader($aid);
    echo " "._ON." $time $timezone ($counter "._READS.")<br></font>\n"


and change to:
Code:
    ."<font class=\"tiny\">"._POSTEDON." ";
    echo "$time $timezone ($counter "._READS.")<br></font>\n"


the result will be in the following format:
Quote:
Posted on Wednesday, June 08 @ GMT Daylight Time (0 reads)
 
View user's profile Send private message
sak







PostPosted: Fri Sep 02, 2005 2:38 pm Reply with quote

The website is ICarry.org

I've tried changing themes too, every theme has the same effect
 
hitwalker







PostPosted: Fri Sep 02, 2005 2:46 pm Reply with quote

hi,

perhaps you are explaining it wrong,or we dont understand but what your describing is normal.
i have exactly the same and if you look at ravens news on the index you see that his name also links to the website url.
 
sak







PostPosted: Fri Sep 02, 2005 2:59 pm Reply with quote

I guess that is normal. I just remembered those links going to profile before Sad

I'll have to look for a mod out there as I would like people to be able to contact me when they click my name. It seems pointless to have all submissions simply link back to the website they are on Shocked
 
hitwalker







PostPosted: Fri Sep 02, 2005 3:02 pm Reply with quote

well if thats what you want you cantry changing the link in your themes.php..changing that would be enough..
 
CodyG
Life Cycles Becoming CPU Cycles



Joined: Jan 02, 2003
Posts: 714
Location: Vancouver Island

PostPosted: Sat Sep 03, 2005 12:03 pm Reply with quote

I like the idea of linking to the user profile from News Stories, too. So, where would I change the link in themes.php? This function is from DeepBlue and is my guess as to where the link would go ... but I'm confused because it looks like it is already linking to the nuke profile. egads, its confusing. Anyways, I'd rather it link to the forums profile. So how would I fix themes.php to do that? Thanks for your help and have a great day.

Quote:

function FormatStory($thetext, $notes, $aid, $informant) {
global $anonymous;
if ($notes != "") {
$notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
} else {
$notes = "";
}
if ("$aid" == "$informant") {
echo "<font class=\"content\">$thetext$notes</font>\n";
} else {
if($informant != "") {
$boxstuff = "<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$informant\">$informant</a> ";
} else {
$boxstuff = "$anonymous ";
}
$boxstuff .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
echo "<font class=\"content\">$boxstuff</font>\n";
}
}

_________________
"We want to see if life is ubiquitous." D.Goldin 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Mon Sep 05, 2005 12:10 am Reply with quote

I have modified my theme (just now) to do what you are asking, I believe. If so, in your themes.php file, find code similar to this
Code:
    $posted = ""._POSTEDBY." ";

    $posted .= get_author($aid);
and change it to
Code:
    $posted = ""._POSTEDBY." ";

    $posted .= "<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$aid\">$aid</a>";
 
View user's profile Send private message
Steptoe







PostPosted: Mon Sep 05, 2005 12:41 am Reply with quote

What would the code change be to remove the link and just leave the posters name?
 
Raven







PostPosted: Mon Sep 05, 2005 12:43 am Reply with quote

$posted .= "$aid";
 
CodyG







PostPosted: Mon Sep 05, 2005 1:23 pm Reply with quote

Is it possible to link to the forum profile? I've tried the following, copied from a user menu block that does link to the forum profile, but in the News Story it only links to a forum info message "Sorry, that user does not exist." Would u=$aid work?

$posted = ""._POSTEDBY." ";
$posted .= "<a href=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=$uid\">$aid</a>";
 
Raven







PostPosted: Mon Sep 05, 2005 5:32 pm Reply with quote

$aid is the author name. You would need to cross reference the $aid with $user_id and then do &u=$user_id.
 
CodyG







PostPosted: Mon Sep 05, 2005 5:55 pm Reply with quote

Thanks Raven. It would be cool, but being this hack isnt' a simple link and therefore beyond my current skills, I think I'll go with the no link option for now.
 
manunkind
Client



Joined: Apr 26, 2004
Posts: 368
Location: Albuquerque, NM

PostPosted: Tue Sep 06, 2005 4:24 pm Reply with quote

Raven wrote:
I have modified my theme (just now) to do what you are asking, I believe. If so, in your themes.php file, find code similar to this
Code:
    $posted = ""._POSTEDBY." ";

    $posted .= get_author($aid);
and change it to
Code:
    $posted = ""._POSTEDBY." ";

    $posted .= "<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$aid\">$aid</a>";


Thanks Raven! Smile
 
View user's profile Send private message Visit poster's website
sak







PostPosted: Fri Sep 23, 2005 10:40 pm Reply with quote

very neat trick, I modified it on my site as well! Maybe FB would wake up and put something like this in his next release (if he isn't too busy adding new bugs). Is there really a purpose to having those redundant links to the site there? Something to do with RSS perhaps?


and I hate to ask it, but I'm sure someone else would soon enough...

Anyone know how to do the cross-referencing that Raven spoke of? Forums profile link would be NICE!
 
Raven







PostPosted: Fri Sep 23, 2005 11:13 pm Reply with quote

Raven wrote:
$aid is the author name. You would need to cross reference the $aid with $user_id and then do &u=$user_id.
I'm heading into bed, but high level:
Code:
list($user_id) = $db->sql_fetchrow($db->sql_query("select user_id from nuke_users where username='$aid'"));

Now you can do &u=$user_id;
 
sak







PostPosted: Sat Sep 24, 2005 2:44 pm Reply with quote

forgive me for being a complete noob. I tried every possible thing I could think of.

Code:


    $posted .= "<a href=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=$user_id\">$aid</a>";


that's what I have for the link with the username link. I tried placing the code you put just about everywhere, and tried declaring stuff and offered my firstborn to the god of scripting. nothing worked for me Sad
 
Raven







PostPosted: Sat Sep 24, 2005 4:27 pm Reply with quote

Did you remember to add $db to your global line? From the original, edit theme.php. Add $db to the global line. Then, find
Code:
    $posted = ""._POSTEDBY." ";

    $posted .= get_author($aid);

and modify to
Code:
    $posted = ""._POSTEDBY." ";

//    $posted .= get_author($aid);
    list($user_id) = $db->sql_fetchrow($db->sql_query("select user_id from nuke_users where username='$aid'"));
    $posted .= "<a href=\"forums.html?amp;file=profile&amp;mode=viewprofile&amp;u=$user_id\">$aid</a>";
 
sak







PostPosted: Sat Sep 24, 2005 5:45 pm Reply with quote

ah forgot to add $db indeed. Always something so simple! Smack

Thanks!

RavensScripts RavensScripts RavensScripts
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Bug Fixes

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 ©