CZforum blocks mod

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   CZforum blocks mod
pnclthnmstsh
CZ Active Member
pnclthnmstsh has been a member for over 20 year's 20 Year Member
usa.gif nevada.gif
Age: 53
Gender: Male
Website:
Status: Offline
Joined: Sep 17, 2004
0.04 posts per day
Posts: 267
Points: 13,641
   
Great addition..but I'm having a conflict with the buddies mod when you click on a members name in the block.

SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3

SELECT buddy_id FROM nuke_bbbuddies WHERE user_id = 8 AND buddy_id =

Line : 269
File : /home/virtual/site44/fst/var/www/html/one/phpnuke/includes/usercp_viewprofile.php

All other username links on the site work fine.




_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
#2   re: CZforum blocks mod
Trubador
CZ Active Member
Trubador has been a member for over 20 year's 20 Year Member
uk.gif
Occupation: Aircraft Technician
Age: 52
Gender: Male
Status: Offline
Joined: Nov 16, 2004
0.01 posts per day
Posts: 104
Points: 4,807
   
I've only just found this error myself m8.

The install file is incorrect.

Several instances of $uid and $username required changing in index.php
This is the updated code required after

//
// Generate the page
//
$template->pparse('body');

// Begin Latest Members
global $prefix;
// How Many to display
$tdsize = 20;
$members = 5;
$query="SELECT username, theme, user_from, user_regdate, user_id from $prefix"._users." ORDER BY user_id DESC LIMIT $members";
   $result=mysql_query($query);
   while(list($username, $theme, $user_from, $user_regdate, $user_id) = mysql_fetch_row($result)) {

      if ($theme == "") {
         $theme = "Default";
         }
      if ($user_from == "") {
         $user_from = "N/A";
         }            
   $ShowLatest .="<td width=\"$tdsize%\" class=\"row1\"><font class=\"content\"><A HREF=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=$user_id\">$username</a><br>Theme: <b>$theme</b><br>Joined: <b>$user_regdate</b><br>Location: <b>$user_from</b></font></td>";
}
echo "<hr width=\"100%\" noShade><br><table border=\"1\" cellspacing=\"2\" width=\"100%\" class=\"forumline\"><tr><td class=\"cat\" colspan=\"2\">$members Latest Members</font></td></tr></table>";
echo "<table border=\"1\" cellspacing=\"1\" cellpadding=\"5\" width=\"100%\" class=\"forumline\" align=\"center\"><tr>";
echo "$ShowLatest";
echo "</tr></table><br />";
// End Latest Members
// Begin Top Posters
global $user_prefix, $dbi;
$tdsize = 20;
$members = 5;
$result=sql_query("SELECT user_id, username, user_posts, user_avatar FROM ".$user_prefix."_users ORDER BY user_posts DESC LIMIT 0,$members", $dbi);
while(list($user_id, $username, $user_posts, $user_avatar) = sql_fetch_row($result, $dbi)) {
if ( ereg( "(http://)", $user_avatar) )
{
$avatar2 = "<img src=\"$user_avatar\" border=\"0\" vspace=\"10\" hspace=\"10\" width=\"48\" align=\"left\">";
} else {
$avatar = $user_avatar;
$avatar2 = "<img src=\"modules/Forums/images/avatars/$avatar\" border=\"0\" vspace=\"10\" hspace=\"10\" width=\"48\" align=\"left\">";
}
if ($avatar2 == "<img src=\"modules/Forums/images/avatars/") {
         $avatar2 = "";
         }
if ( empty($user_avatar) )

   {
}
$Topposters .="<td width=\"$tdsize%\" class=\"row1\"><font class=\"content\"><a href=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=$user_id\">$avatar2</a><br><a href=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=$user_id\">$username</a><br>Posts: <a href=\"modules.php?name=Forums&amp;file=search&amp;search_author=$user_id\">$user_posts</a></font></td>";
}
echo "<hr width='95%' noShade><br><table border=\"1\" cellspacing=\"2\" width=\"100%\" class=\"forumline\"><tr><td class=\"cat\" colspan=\"2\">Top 5 Posters</font></td></tr></table>";
echo "<table border=\"1\" cellspacing=\"1\" cellpadding=\"5\" width=\"100%\" class=\"forumline\" align=\"center\"><tr>";
echo "$Topposters";
echo "</tr></table>";
/*Copyright notice - Do not remove*/
echo "<div align=\"right\"><small>";
echo "<a href=\"http://codezwiz.com\">Forum Blocks &copy;</a></small><br></div>";
/*Copyright notice - Do not remove*/
// End Top Posters


Works a treat now. Maybe one of the staff can update CZForum-blocks1.0.1.txt.

Cheers

Trub



_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
#3   
pnclthnmstsh
CZ Active Member
pnclthnmstsh has been a member for over 20 year's 20 Year Member
usa.gif nevada.gif
Age: 53
Gender: Male
Website:
Status: Offline
Joined: Sep 17, 2004
0.04 posts per day
Posts: 267
Points: 13,641
   
You are correct sir icon_biggrin.gif I found that as well a few weeks ago but moved across the country and I'm just now getting back into straightening up this moving mess and didn't have time to post back that I had fixed my site...thanks for posting the fix for everyone!!




_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
#4   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,475
   
Must have been a problem with uid or username. The list method lists what you pull from the database regardless of the field name. Some other mod or hack using uid will cause problems. The original mod is just fine but if you have other mods installed this method will work. Thanks for posting.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#5   re: CZforum blocks mod
Trubador
CZ Active Member
Trubador has been a member for over 20 year's 20 Year Member
uk.gif
Occupation: Aircraft Technician
Age: 52
Gender: Male
Status: Offline
Joined: Nov 16, 2004
0.01 posts per day
Posts: 104
Points: 4,807
   
Ah.... thanks for that Telli, I could of sworn it was working a while ago. Thought I was going mad.




_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
#6   
pnclthnmstsh
CZ Active Member
pnclthnmstsh has been a member for over 20 year's 20 Year Member
usa.gif nevada.gif
Age: 53
Gender: Male
Website:
Status: Offline
Joined: Sep 17, 2004
0.04 posts per day
Posts: 267
Points: 13,641
   
One more edit needs to be made to the above code

Find
search_author=$user_id\">$user_posts

Replace with
search_author=$username\">$user_posts

This makes the post count number search link work right




_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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 cannot attach files in this forum
You cannot download files in this forum