Help with online users/recent posts

Talk about anything to do with making sites or running Servers.
Jed
just visiting
Posts: 5
Joined: Sun Dec 03, 2006 6:17 am

Post by Jed »

id like to know how to get the online users and the last posts. So i can put that on my site. is there a mod or something? or did u code it urself?
<a href="http://toxicproductions.2ya.com"><img src="http://www.daboys4u.com/images/admin2.png"><br>Check out my site =]</a><br><a href='http://toxicproductions.2ya.com' target='_blank'>http://toxicproductions.2ya.com</a>
binarydata
DBfiller
Posts: 3816
Joined: Fri Oct 31, 2003 5:30 am
Location: San Diego CA, USA
Contact:

Post by binarydata »

uh, those are parts of the forum
<img src='http://img88.exs.cx/img88/2290/7666.jpg' border='0' alt='user posted image' />
ADDKiD
&lt;3 bd long time
Posts: 967
Joined: Tue Jul 12, 2005 8:07 pm
Location: Washington, USA
Contact:

Post by ADDKiD »

You'll have to dig through tons of php to find it. I wouldn't worry about it at all... It's nothing compared to some of the things you can do.
Jed
just visiting
Posts: 5
Joined: Sun Dec 03, 2006 6:17 am

Post by Jed »

Well my goals are a script to show the most recent posts and a active chat window at the top of the forums. Like on a old hb server i think locobans hosted.
<a href="http://toxicproductions.2ya.com"><img src="http://www.daboys4u.com/images/admin2.png"><br>Check out my site =]</a><br><a href='http://toxicproductions.2ya.com' target='_blank'>http://toxicproductions.2ya.com</a>
bone-you
Spamtastic
Posts: 1310
Joined: Wed Mar 16, 2005 3:12 am

Post by bone-you »

I made this long ago before I knew how to join tables but it works. It's what's on my front page <a href='http://www.helbreathx.net' target='_blank'>http://www.helbreathx.net</a> .

Code: Select all

	$posts = mysql_connect('localhost', 'user', 'pass');
	if (!$posts) { /*echo 'Unable to establish mySQL connection';*/ return; }
	if (!mysql_select_db('invisiondb', $posts)) { /*echo 'Unable to select DB';*/ return; }
	$firstquery = 'SELECT * FROM ibf_topics WHERE `forum_id`!=\'15\' AND `forum_id`!=\'4\' AND `forum_id`!=\'34\' AND `forum_id`!=\'95\' AND `forum_id`!=\'35\' AND `forum_id`!=\'16\' AND `forum_id`!=\'96\' AND `forum_id`!=\'97\' AND `forum_id`!=\'98\' AND `forum_id`!=\'100\' AND `forum_id`!=\'131\' AND `forum_id`!=\'132\' ORDER BY `last_post` DESC LIMIT 10;';
	$firstresult = mysql_query($firstquery, $posts);
	$forumview = "<table width=\"100%\" border=\"3\" bordercolor=\"gray\">";
	$forumview .= "<tr><td align=\"center\">Recent Active Threads</td></tr>";
	while ($line = mysql_fetch_assoc($firstresult)) {
  $secondquery = "SELECT * FROM ibf_posts WHERE `topic_id`=".$line['tid']." ORDER BY `post_date` DESC;";
  $secondresult = mysql_query($secondquery, $posts);
  $line2 = mysql_fetch_assoc($secondresult);
  if (strlen($line['title']) > 20) {
  	$edittitle = chardisplay($line['title'], 20);
  } else {
  	$edittitle = $line['title'];	
  }
  $forumview .= "
<tr>\n
	<td>\n
  <font face=\"Verdana\" size=\"1\">\n
  <a href=\"http://forum.helbreathx.net/index.php?showtopic=".$line['tid']."&view=getnewpost\" title=\"".$line['title']." by ".$line2['author_name']." on ".date('n/j/y g:i:sa' ,$line2['post_date'])."\">
  ".$edittitle."<br />
  ".$line2['author_name']." - ".date('n/j/y g:i:sa' ,$line2['post_date'])."
  </a>\n
  </font>\n
	</td>\n
</tr>\n";
	}
	$forumview .= "</table>\n";
the
`forum_id`!=\'15\' AND `forum_id`!=\'4\' AND `forum_id`!=\'34\' AND `forum_id`!=\'95\' AND `forum_id`!=\'35\' AND `forum_id`!=\'16\' AND `forum_id`!=\'96\' AND `forum_id`!=\'97\' AND `forum_id`!=\'98\' AND `forum_id`!=\'100\' AND `forum_id`!=\'131\' AND `forum_id`!=\'132\'

is where you specify private sections or just sections you don't want displayed on the page.

The chardisplay function, don't worry about it. It's how I truncated lines that were longer than specified width. (sexy function too. If the line is a little over 20 it'll still display the full thing xD)

If you must:

Code: Select all

function chardisplay($string, $num) {
	$count = 0;
	$temp = '';
	if (strlen($string) < $num + ($num * 0.10))
	$num = $num + ($num * 0.10);
	while ($count < $num) {
  $temp .= $string[$count];  
  $count++;
	}
	if (strlen($string) > $num)
	{
  $temp .= "...";
	}
	return $temp;
}
Anyway. Enjoy :)
<img src='http://www.helbreathx.net/sig/sig.jpeg' border='0' alt='user posted image' /><br><a href='http://mafia.cheats4us.org/index.php?x=231030' target='_blank'>#1 on Mafia :D</a><br><!--QuoteBegin-Slipknight+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Slipknight)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->100mb Internet, burstable too 10GB oc192<br>his speed can go up too 10gbs<br>...<br>Yes my car can have a top speed of 1000mph<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br>^^ I wonder where the retard went to.
Jed
just visiting
Posts: 5
Joined: Sun Dec 03, 2006 6:17 am

Post by Jed »

do i just insert that right into the html file or ...? my guess make a .php file insert the code into it then make the name like new posts then link the php to the html some how hellpp lol. im a newbie at this php stuff.... but im getting it. just need some assistance please.
<a href="http://toxicproductions.2ya.com"><img src="http://www.daboys4u.com/images/admin2.png"><br>Check out my site =]</a><br><a href='http://toxicproductions.2ya.com' target='_blank'>http://toxicproductions.2ya.com</a>
ADDKiD
&lt;3 bd long time
Posts: 967
Joined: Tue Jul 12, 2005 8:07 pm
Location: Washington, USA
Contact:

Post by ADDKiD »

I think you would add this to your main pages. Orient them where ever you want too. Depending on the size of the box or w/e needed. This should work for you. Yes, PHP would be good to use. =) If you want some help, add me to MSN. I've done some PHP work myself, and I know quite a few people who can Help you if I can't. I'm amazed Zero knows PHP, shit, his brain must be a fucking Yottabyte....
bone-you
Spamtastic
Posts: 1310
Joined: Wed Mar 16, 2005 3:12 am

Post by bone-you »

ADDKiD wrote: I think you would add this to your main pages. Orient them where ever you want too. Depending on the size of the box or w/e needed. This should work for you. Yes, PHP would be good to use. =) If you want some help, add me to MSN. I've done some PHP work myself, and I know quite a few people who can Help you if I can't. I'm amazed Zero knows PHP, shit, his brain must be a fucking Yottabyte....
You're amazed I know PHP? You know my job is doing PHP? My entire site is based on PHP? Did you not know that? It's not like every single one of my pages end in .php.. nooo...
<img src='http://www.helbreathx.net/sig/sig.jpeg' border='0' alt='user posted image' /><br><a href='http://mafia.cheats4us.org/index.php?x=231030' target='_blank'>#1 on Mafia :D</a><br><!--QuoteBegin-Slipknight+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Slipknight)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->100mb Internet, burstable too 10GB oc192<br>his speed can go up too 10gbs<br>...<br>Yes my car can have a top speed of 1000mph<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br>^^ I wonder where the retard went to.
Orkl
Loyal fan
Posts: 376
Joined: Sat Sep 17, 2005 2:31 pm

Post by Orkl »

bone-you wrote:
ADDKiD wrote: I think you would add this to your main pages. Orient them where ever you want too. Depending on the size of the box or w/e needed. This should work for you. Yes, PHP would be good to use. =) If you want some help, add me to MSN. I've done some PHP work myself, and I know quite a few people who can Help you if I can't. I'm amazed Zero knows PHP, shit, his brain must be a fucking Yottabyte....
You're amazed I know PHP? You know my job is doing PHP? My entire site is based on PHP? Did you not know that? It's not like every single one of my pages end in .php.. nooo...
rofl

I know PHP too, its so ez its fun
<!--QuoteBegin-crazymnig88+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (crazymnig88)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->by notepad??? it didn't show any code, just show words wif no mean<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br><!--QuoteBegin-charlie+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (charlie)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->he'll probably save it as 600pagebook.bmp<br><br>400gb file plzkthnx<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd-->
binarydata
DBfiller
Posts: 3816
Joined: Fri Oct 31, 2003 5:30 am
Location: San Diego CA, USA
Contact:

Post by binarydata »

ya srsly php is easy
<img src='http://img88.exs.cx/img88/2290/7666.jpg' border='0' alt='user posted image' />
bone-you
Spamtastic
Posts: 1310
Joined: Wed Mar 16, 2005 3:12 am

Post by bone-you »

oh and for those who will never get why it won't display, replace $forumview .= with just an echo or something. or echo $forumview; at the end.
<img src='http://www.helbreathx.net/sig/sig.jpeg' border='0' alt='user posted image' /><br><a href='http://mafia.cheats4us.org/index.php?x=231030' target='_blank'>#1 on Mafia :D</a><br><!--QuoteBegin-Slipknight+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Slipknight)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->100mb Internet, burstable too 10GB oc192<br>his speed can go up too 10gbs<br>...<br>Yes my car can have a top speed of 1000mph<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br>^^ I wonder where the retard went to.
Jensen
Loyal fan
Posts: 300
Joined: Tue Aug 02, 2005 7:40 am
Location: Illinois, USA
Contact:

Post by Jensen »

bone-you wrote: You're amazed I know PHP? You know my job is doing PHP? My entire site is based on PHP? Did you not know that? It's not like every single one of my pages end in .php.. nooo...
i have a php files that runs inside the .mp3 extension on one server, stupid windows media player doesn't like media streams with wrong extensions regardless of sent mime types in some versions...

I'm surprised no one has killed him yet with how he just throws around buzzwords and sports random crap where he can.

-><-
ADDKiD
&lt;3 bd long time
Posts: 967
Joined: Tue Jul 12, 2005 8:07 pm
Location: Washington, USA
Contact:

Post by ADDKiD »

Jensen wrote:
bone-you wrote: You're amazed I know PHP? You know my job is doing PHP? My entire site is based on PHP? Did you not know that? It's not like every single one of my pages end in .php.. nooo...
i have a php files that runs inside the .mp3 extension on one server, stupid windows media player doesn't like media streams with wrong extensions regardless of sent mime types in some versions...

I'm surprised no one has killed him yet with how he just throws around buzzwords and sports random crap where he can.
Lol.... Yeah, It's fun to piss you guys off. I find joy in annoying people.
bone-you
Spamtastic
Posts: 1310
Joined: Wed Mar 16, 2005 3:12 am

Post by bone-you »

ADDKiD wrote:
Jensen wrote:
bone-you wrote: You're amazed I know PHP? You know my job is doing PHP? My entire site is based on PHP? Did you not know that? It's not like every single one of my pages end in .php.. nooo...
i have a php files that runs inside the .mp3 extension on one server, stupid windows media player doesn't like media streams with wrong extensions regardless of sent mime types in some versions...

I'm surprised no one has killed him yet with how he just throws around buzzwords and sports random crap where he can.
Lol.... Yeah, It's fun to piss you guys off. I find joy in annoying people.
You can't piss anyone off. Annoy, yes. Piss off? Why don't you.
<img src='http://www.helbreathx.net/sig/sig.jpeg' border='0' alt='user posted image' /><br><a href='http://mafia.cheats4us.org/index.php?x=231030' target='_blank'>#1 on Mafia :D</a><br><!--QuoteBegin-Slipknight+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Slipknight)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->100mb Internet, burstable too 10GB oc192<br>his speed can go up too 10gbs<br>...<br>Yes my car can have a top speed of 1000mph<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br>^^ I wonder where the retard went to.
ADDKiD
&lt;3 bd long time
Posts: 967
Joined: Tue Jul 12, 2005 8:07 pm
Location: Washington, USA
Contact:

Post by ADDKiD »

Your your the kind of people I'd like to put a bullet between the eyes. I would enjoy it too...
Post Reply