TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 629
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 413
  • Total: 413

Random post from specific topic

Started by morskisrle, November 11, 2007, 05:55:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

alving

#10
i like this code!  thanks!  a bit of a request if this is possible to do. 

is it possible to display the avatar and username (which is linked to its profile) of the author of the specific topic or thread everytime the random post is displayed?

and how do i edit the code so that the "MORE" text is underneath the poster name instead of besides it.  all of them aligned to the center.

this is what it would look like in a sidebar

Avatar of author or thread starter
Username (linked to profile)
Random post in that topic
Poster name (same format, linked to profile)
More (same, linked to the specific post)

obviously, i don't have any knowledge of php  :uglystupid2: so please help  :)

thanks in advance!


alving


alving

what are the things i need to edit if i want to put this code in a center block? 

thanks in advance

alving

hi jpdeni,

need your help in this one  :) i really liked this code as this always provide a "new" post in my frontpage. 

how do i display an image before the generated random post? 

thanks in advance

JPDeni

Assuming this is the code for printing out the post:


echo '<div style="text-align: center; width: 150px; height: 200px; overflow: auto;" >' . $row['body'] . '<br />';


use


echo '<div style="text-align: center; width: 150px; height: 200px; overflow: auto;" ><img src="http://www.url/to/image.jpg">' . $row['body'] . '<br />';


Sorry I didn't respond to your earlier posts. I was in the hospital at the time you posted them.

alving

thanks heaps, jpdeni!

QuoteSorry I didn't respond to your earlier posts. I was in the hospital at the time you posted them.
it's all good, jpdeni.. you've done enough..  thanks again.. don't bother with it..

This website is proudly hosted on Crocweb Cloud Website Hosting.