Nukemods Forum  
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 54
3 members and 51 guests
buynm6ymobcha8b, cliaw9cckhereto, int5nwernetmarx
Most users ever online was 611, 03-21-2008 at 10:10 PM.
» .::.
» .:.

Go Back   Nukemods Forum > NM Staff > Purged Topics

Reply
 
LinkBack Thread Tools Display Modes
Help With a Block, Please
Old
  (#1 (permalink))
Junior Member
 
Status: Offline
Posts: 38
Join Date: Mar 2003
Help With a Block, Please - 04-08-2003, 12:32 PM

Hello,

I downloaded a Last 5 block from phpdownloads.com, which shows the last 5 articles, links, downloads, and forum topics as a center block. Apparently, there is an error with the block, because whenever you click one of the new links, it pulls out the link from the database, but displays it as a Download!

I've isolated the bad code here:

Code:
$content .= "</td><td align=\"left\" valign=\"top\">";
$a = 1;
$result = sql_query("select lid, title from $prefix"._links_links." order by date DESC limit 0,10", $dbi);
while(list($lid, $title) = sql_fetch_row($result, $dbi)) {
    $title2 = ereg_replace(" ", "_", $title);
    $content .= "<img src=\"images/visitors/forums.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\">&<a href=\"modules.php?name=Downloads&d_op=viewdownloaddetails&lid=$lid&ttitle=$title2\">$title</a>
";
    $a++;
I know I need to change the modules.php statement to send it to Web_Links instead of Downloads, but how I change the rest of the line? I tried many things, but only got SQL errors.

You can see the whole thing on the bottom of http://community.coptichymns.net/ and the errors you get when clicking on one of the new links.

Some help from the experts would be appreciated.

Thanks,
Paul
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#2 (permalink))
Senior Member
 
Status: Offline
Posts: 2,905
Join Date: Sep 2002
04-08-2003, 02:34 PM

I just noticed this part

Code:
"<img src=\"images/visitors/forums.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\">&<a href=\"modules.php?name=Downloads&d_op=viewdownloaddetails&lid=$lid&ttitle=$title2\">$title</a>
";
Is that part right here right?
Code:
ttitle=$title2
or should it be
Code:
title=$title2
notice the two t's ?
I'm just guessing...

mikem
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#3 (permalink))
Moderator
 
Status: Offline
Posts: 957
Join Date: Nov 2002
Location: Belgium
04-08-2003, 02:45 PM

I'm not sure but in your code I think you have to change this
Code:
modules.php?name=Downloads&d_op=viewdownloaddetails&lid=$lid&ttitle=$title2
To this
Code:
modules.php?name=Web_Links&l_op=visit&lid=$lid
And then it will give a direct link to that site

I tested it (for what I can test it without the block but it should work

Bye,
Mighty_Y
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#4 (permalink))
Junior Member
 
Status: Offline
Posts: 38
Join Date: Mar 2003
04-08-2003, 03:27 PM

Thanks for the help, guys.

Mike and Mighty helped me narrow down the problems (yes, more than one) with this block.

Here is the correct code, which works great for me:

Code:
$content .= "</td><td align=\"left\" valign=\"top\">";
$a = 1;
$result = sql_query("select cid, title from $prefix"._links_links." order by date DESC limit 0,10", $dbi);
while(list($cid, $title) = sql_fetch_row($result, $dbi)) {
    $title2 = ereg_replace(" ", "_", $title);
    $content .= "<img src=\"images/visitors/forums.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\">&<a href=\"modules.php?name=Web_Links&l_op=viewlink&cid=$cid&ttitle=$title2\">$title</a>
";
    $a++;
We couldn't use LID, apparently, because there is no LID that will return a single link by itself. I could be wrong on this, but when I changed everything to CID and had the program list the new links in their categories with other links, it worked fine:

http://community.coptichymns.net/

Many thanks to our experts here, who are helpful as always.
Paul
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





vBulletin Skin developed by: vBStyles.com


LinkBacks Enabled by vBSEO 3.3.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31