» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 75
0 members and 75 guests
No Members online
Most users ever online was 611, 03-21-2008 at 10:10 PM.
» .::.
Web Hosting - web hosting, dedicated servers and web design services
Online Degree - search for 1000+ online degrees, online colleges & online universities.
tattoo - we are a group of tattoo enthusiasts
Gexa Energy - your absolute best choice in electric service
Texas electricity - save on electric rates
Rimonabant - combat obesity and smoking at the same time
Football Betting - best nfl betting promotions at sportsbook.com.
Poker Chips - Clay and composite poker chips for home games.

Register Now! Contact Us

About this Page
This is a discussion on Help With a Block, Please within the Purged Topics forums, part of the NM Staff category; Hello, I downloaded a Last 5 block from phpdownloads.com, which shows the last 5 articles, links, downloads, and forum ...



Go Back   Nukemods Forum » NM Staff » Purged Topics

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-08-2003, 12:32 PM
Junior Member
 
Join Date: Mar 2003
Posts: 38
Help With a Block, Please
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
  #2 (permalink)  
Old 04-08-2003, 02:34 PM
Senior Member
 
Join Date: Sep 2002
Posts: 2,905
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
  #3 (permalink)  
Old 04-08-2003, 02:45 PM
Moderator
 
Join Date: Nov 2002
Location: Belgium
Posts: 957
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
  #4 (permalink)  
Old 04-08-2003, 03:27 PM
Junior Member
 
Join Date: Mar 2003
Posts: 38
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



All times are GMT -5. The time now is 03:31 PM.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.

LinkBacks Enabled by vBSEO 3.1.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