Help with online users/recent posts
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>
-
- DBfiller
- Posts: 3816
- Joined: Fri Oct 31, 2003 5:30 am
- Location: San Diego CA, USA
- Contact:
uh, those are parts of the forum
<img src='http://img88.exs.cx/img88/2290/7666.jpg' border='0' alt='user posted image' />
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>
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> .
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:
Anyway. Enjoy
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";
`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;
}
<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 </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.
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>
-
- <3 bd long time
- Posts: 967
- Joined: Tue Jul 12, 2005 8:07 pm
- Location: Washington, USA
- Contact:
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...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....
<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 </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.
roflbone-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...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....
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-->
-
- DBfiller
- Posts: 3816
- Joined: Fri Oct 31, 2003 5:30 am
- Location: San Diego CA, USA
- Contact:
ya srsly php is easy
<img src='http://img88.exs.cx/img88/2290/7666.jpg' border='0' alt='user posted image' />
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 </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.
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...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'm surprised no one has killed him yet with how he just throws around buzzwords and sports random crap where he can.
-><-
-
- <3 bd long time
- Posts: 967
- Joined: Tue Jul 12, 2005 8:07 pm
- Location: Washington, USA
- Contact:
Lol.... Yeah, It's fun to piss you guys off. I find joy in annoying people.Jensen wrote: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...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'm surprised no one has killed him yet with how he just throws around buzzwords and sports random crap where he can.
You can't piss anyone off. Annoy, yes. Piss off? Why don't you.ADDKiD wrote:Lol.... Yeah, It's fun to piss you guys off. I find joy in annoying people.Jensen wrote: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...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'm surprised no one has killed him yet with how he just throws around buzzwords and sports random crap where he can.
<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 </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.