show most popular articles - help needed

Discussion in 'PHP' started by clouting, Dec 18, 2007.

  1. #1
    hey all..........

    i want a script that will show the highest rated article on my site.... At the moment it shows the most poular articles but only displays the article name. I want it to show the corresponding thumbnail with the name.

    Could some one give me some help as i am a bit of a novice...

    thanks in advance
     
    clouting, Dec 18, 2007 IP
  2. itliberty

    itliberty Peon

    Messages:
    1,173
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Where is the thumbnail name kept, in the DB or in an images folder? In order to really give code specifics we would need to know field names etc..but here goes.

    Assuming fiedl name is "title" and files are JPG's held in the images folder...

    <?php echo "<img src='images/".$title.".jpg'>"; ?>

    Make sure you notice the difference of quotes (") and single ticks ('). The periods (.) separate your continues string and the variabel name...so the quotes contain the string, the ticks are the same as using \"

    So this display code <img src='images/ stops, displays the variable and then continues with .jpg'> to create your image tag.

    You can ask other questions to http://askthecomputergeek.com and I will post replies to php code questions on the site with longer explanations.

    Hope this helped
     
    itliberty, Dec 18, 2007 IP
  3. vvtv

    vvtv Well-Known Member

    Messages:
    818
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    110
    #3
    Which article directory script you are using?
     
    vvtv, Dec 18, 2007 IP
  4. clouting

    clouting Guest

    Messages:
    120
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    ok. thanks itliberty

    i will follow the link if i have any problems.

    cheers
     
    clouting, Dec 18, 2007 IP