Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 08-23-2000 Last Update: Never Installs: 0
 
No support by the author.

Okay i thought i'd start a new thread ... how did tech talk do the today's active topics code hack to include it on a non vb page..

i have added most of the includes that tech talk released on my test index page at

now all i am missing are

1. active topics includes
2. displaying total threads
3. displaying total posts
4. displaying total registered members
5. displaying most recent registered member

any help is appreciated


[Edited by eva2000 on 01-04-2001 at 12:43 PM]

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #62  
Old 01-04-2001, 02:33 PM
Guest
 
Posts: n/a
Default

This took a little figgerin' so I thought I'd post it so others wouldn't have to. This snippet is for non-VB pages, it will show the thread posted within the last 24 hours that has the most views.

If you change $daysback to something else, you can pull from the last week, etc.

Code:
require("/full/path/to/admin/config.php");
$db=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname);

$daysback=1;
$datecut=time()-($daysback * 86400);
$query = "SELECT threadid,title,views,dateline FROM thread WHERE dateline > '".$datecut."' ORDER BY views DESC LIMIT 1";
$resultlatest = mysql_query($query,$db_connection);
$latest_array = mysql_fetch_array($resultlatest);

$mvtitle = $latest_array[title];
$mvid = $latest_array[threadid];
Then simply print out the $mvtitle and $mvid wherever you want to link to this active topic.
Reply With Quote
  #63  
Old 01-04-2001, 02:36 PM
Guest
 
Posts: n/a
Default

Oh yea.. I also run this piece of code on any thread title I pull-- if it's too long it will truncate it and add ...

Code:
if (strlen($latest_array["title"]) > 40) {
   $mvtitle = substr($latest_array["title"],0,37) . "...";
}
Reply With Quote
  #64  
Old 02-11-2001, 01:53 PM
Guest
 
Posts: n/a
Default

Hi,

I'm sorry to bring this up now, but I need help. I want to display the ten latest topics on mymessage boards automatically. I read many of the above posts and didn't find exactly what I'm looking for, that's why I'm posting here. I have little knowledge of PHP and MySQL, so don't confuse me too much. I want to exclude posts from a few boards and I just wanted to list them on my main page.

It is my assumption that if I use a PHP code, I can modify my .htaccess file to read the PHP on my main page and make it not require the .shtml extension to be changed to .php3. Any help would be appreciated.
Reply With Quote
  #65  
Old 02-11-2001, 02:03 PM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by M. James
It is my assumption that if I use a PHP code, I can modify my .htaccess file to read the PHP on my main page and make it not require the .shtml extension to be changed to .php3. Any help would be appreciated.
Add this to you .htaccess file
Code:
AddType application/x-httpd-php3 .shtml

Script for Active topics, anumber of people have worked on this including Dark_Wizard.
BTW... Has anyone added vB templates to this script, if so could you share or tell me how to do it.

Code:
<?

require("config.php");
// number of active topics to show
	$num_active = 5;
// number of pagetext characters to show
	$num_chars  = 70;

	$db=mysql_connect($servername,$dbusername,$dbpassword);
	mysql_select_db($dbname);

// Remove the forums you don't want listed

	$querylatest="select * from thread where forumid='1' or forumid='2' or forumid='3' or forumid='4' or forumid='5' or forumid='6' or forumid='7' or forumid='8' or forumid='10' or forumid='11' or forumid='12' or forumid='13' or forumid='14' or forumid='15' or forumid='16' or forumid='17' or forumid='18' or forumid='19' or forumid='20' or forumid='22' or forumid='23' or forumid='25' or forumid='26' or forumid='27' or forumid='28' or forumid='29' or forumid='30' or forumid='31' or forumid='32' or forumid='34' or forumid='35' or forumid='36' or forumid='37' or forumid='38' order by lastpost desc limit $num_active";

	$resultlatest = mysql_query($querylatest,$db);

	print("<center><table width=\"100%%\" cellspacing=\"0\" cellpadding=\"2\">");

	while ($latest_array = mysql_fetch_array($resultlatest)) {
	
	// Get Forum Infomation
	$query_forum = "select * from forum where forumid='$latest_array[forumid]'";
	$result_forum = mysql_query($query_forum,$db);
	$forum_info_array = mysql_fetch_array($result_forum);
	

	// split the date up a bit 
	$datestr1 = substr($latest_array["dateline"],0,10);
	$datetime = substr($latest_array["dateline"],11,8);	
	printf("<tr><td align=\"left\"><b><font color=\"#FFFFCC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">%s: %s</font></b></td></tr>",$forum_info_array["title"],$latest_array["title"]);

	$querythread="select * from post where threadid='$latest_array[threadid]' order by dateline asc limit 1";

	$result_thread_text= mysql_query($querythread,$db);

	$result_thread_array = mysql_fetch_array($result_thread_text);
	printf ("<td width=\"100%%\"><font color=\"#FFCC66\" face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><img src=\"images/icons/icon%s.gif\"> Started By: %s &nbsp;&nbsp;&nbsp;&nbsp; Last Post By: %s<br><font color=\"#FFFFFF\">%s...<a href=\"showthread.php?threadid=%s\">&nbsp;&nbsp;(Click here for more)</font></a><hr color=\"#003366\"></td></tr>",$result_thread_array["iconid"],$latest_array["postusername"],$latest_array["lastposter"],substr(strip_tags($result_thread_array["pagetext"]),0,$num_chars),$latest_array["threadid"]);
	printf ("<tr><td width=\"100%%\"> </td></tr>");
	}

	printf ("</table></center>");
?>
Reply With Quote
  #66  
Old 08-18-2001, 04:46 PM
Evoir Evoir is offline
 
Join Date: Nov 2001
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way to use an SSI to include this script? Does it have to be called with a php include?
Reply With Quote
  #67  
Old 08-28-2001, 06:24 PM
jcroft jcroft is offline
 
Join Date: Nov 2001
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can anyone post the code for displaying currently logged on members in a non-vb page?

Thanks a lot,

Jeff Croft
newBeetle.org
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 01:56 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04077 seconds
  • Memory Usage 2,261KB
  • Queries Executed 21 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (2)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_imicons
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete