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: 06-26-2000 Last Update: Never Installs: 0
 
No support by the author.

Hi,

I'm looking for a PHP script which displays the first 30 lines (or so) of every topic from a forum, which I dedicated to News, on the front page of our web site.
Only moderators or admins can post new threads (the News articles) all other can only comment on them. I would like to have a link "Read more" below of every 30 lines excerpt pointing to the full article and a link "Comments" pointing to the full discussion thread.

I've seen the Active Topics script and probably I could use it as a starting point but I would also like to have the vB-Code support, Smilie support and automatic web address parsing etc.. which the vB scripts have, not just plain text. And then it gets difficult for me since I'm new to PHP.

Does anyone have already written such a PHP script or could give me other useful pointers for writing such a beast?

Thanks in advance

Show Your Support

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

Comments
  #2  
Old 06-26-2000, 04:27 AM
Guest
 
Posts: n/a
Default

Yes this would be great!
Reply With Quote
  #3  
Old 06-29-2000, 08:05 AM
Guest
 
Posts: n/a
Default

would not know how to do this, but it sound greate

- especialy with an option of "last post" in a tread instet of first post.
Reply With Quote
  #4  
Old 06-29-2000, 08:18 AM
Guest
 
Posts: n/a
Default

take the script you meantioned, and modify it a bit. It should not be too hard.

basically, you have a script with these functions:

-connect to db
-get threadid's of the threads you want displayed (date limit?)
-parse the text of the threads and misimise to 30 lines (better do 60 words or so)
-output the text
Reply With Quote
  #5  
Old 06-29-2000, 09:19 AM
Guest
 
Posts: n/a
Default

I've already written such a news log (also called weblog) script myself now.
Yesss...

I used forumdisplay.php and showthread.php as a starting point, a lot of copy and paste (really a lot), some new templates etc. and it's already working - including support for vB code, similies etc.. I had some problems calling the script from within the front page (index.html) of the web site instead of inside the vB folder but I could fix that (there were slight changes to global.php necessary).

I noticed also that I had no clear idea how to show the 'first few lines' since the line number depends on the HTML formatting. Counting sentences or words wasn't a good idea either because some news writers here wanted to determine the size of the intro text by themselves. So I added support for a tag '{RM}' which tells my script to stop printing the text and instead it creates a link pointing to the article (i.e. to the top of the thread). The text for this link just reads 'Read more...' + a 'Commments(n)' link where n is the number of replies to the news article.
The news writer has to insert such a {RM} tag himself in the article which is ok for me.

If somebody is interested I would release the script after some cleanup. I'm a PHP beginner so it's not very clean yet - it's more or less copy&paste from the vB scripts. So there is a lot of redundant stuff in there etc.. It might also be that it works only with PHP4 for some reasons.

BTW, I'm glad that I bought the vB and not one of those unreadable Perl based forum systems because after 4 days playing around with PHP I think PHP is pretty cool. You can start progamming within one day if you know some C.
Reply With Quote
  #6  
Old 07-07-2000, 10:20 AM
Guest
 
Posts: n/a
Default

I'd love to have this hack if you release it. This would be the ideal way of including news items on my front page...

thanks!
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 02:24 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07997 seconds
  • Memory Usage 2,228KB
  • Queries Executed 19 (?)
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
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (6)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete