Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by merk merk is offline
Developer Last Online: Mar 2012 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 08-28-2001 Last Update: Never Installs: 1
 
No support by the author.

Well, after very little effort on my behalf, i have released version 1.2.

Not much new, however-

I have added a headlines system, which is basically it

Anyway, it works exactly the same way as the original, just setup a news forum(you can set its display order to 0, if you wish for noone to actually see it. i also recomend only allowing normal members to reply, not post

Just create a template, headlinebit and add the following
Code:
<smallfont>-></smallfont> <normalfont><a href="$forumspath/showthread.php?s=&threadid=$newsarray[threadid]">$newsarray[title]</a> by <a href=\"$forumspath/member.php?s=&action=getinfo&userid=$newsarray[postuserid]\">$newsarray[postusername]</a></normalfont><smallfont> ($dateposted)</smallfont><br>
You can customise it, and you have access to all field names in the thread table. (check out the ERD in the members area, Keir )

As easy as it is, to access the headlines(or include them) add
Code:
?action=headlines
or to include
PHP Code:
<? include('/path/to/news.php?action=headlines'); ?>

Not much else i can rant about, im a bit lonely tonight

Anyway, heres the script:

(attached)

PS. like most scripts, just place this into your /forum/ directory, where its with its buddies(like index.php and global.php)

I just thought of another feature to add, which will come later tonight hopefully!(most commented news items, of course which would expire after a certain date offset of the current date)

Show Your Support

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

Comments
  #12  
Old 08-30-2001, 01:09 AM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ill need the $newsquery lines please.
Reply With Quote
  #13  
Old 08-30-2001, 05:14 AM
IanMFT IanMFT is offline
 
Join Date: Oct 2001
Location: Long Island, NY
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

$newsquery = "SELECT thread.*, post.*";
$newsquery .= " FROM thread,post";
$newsquery .= " WHERE post.threadid=thread.threadid";
$newsquery .= " AND thread.forumid=$newsforums";
$newsquery .= " GROUP BY thread.threadid";
$newsquery .= " ORDER BY thread.dateline DESC";
$newsquery .= " LIMIT $newsitems";


sorry bout' that
Reply With Quote
  #14  
Old 08-30-2001, 05:26 AM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by IanMFT
newsquery = "SELECT thread.*, post.*";
$newsquery .= " FROM thread,post";
$newsquery .= " WHERE post.threadid=thread.threadid";
$newsquery .= " AND thread.forumid=$newsforums";
$newsquery .= " GROUP BY thread.threadid";
$newsquery .= " ORDER BY thread.dateline DESC";
$newsquery .= " LIMIT $newsitems";
$newsquery = "SELECT thread.*, post.*";
$newsquery .= " FROM thread,post";
$newsquery .= " WHERE post.threadid=thread.threadid";
$newsquery .= " AND thread.forumid=$newsforums";
$newsquery .= " GROUP BY thread.threadid";
$newsquery .= " ORDER BY thread.dateline DESC";
$newsquery .= " LIMIT $newsitems";
^^ Hrm, thats the one i use, and it works fine.

Might just want to try reuploading the file.
Reply With Quote
  #15  
Old 08-30-2001, 05:27 AM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem about that either, just the newsbit template doesnt tell you much.
Reply With Quote
  #16  
Old 08-30-2001, 01:02 PM
pier
Guest
 
Posts: n/a
Default

I've a problem with the query showing ups thread titles & post text.

OpNEWS doesn't display the right pagetext if there're more than 1 post in the thread.

am I the only one with problems like this ?

thanks
pier
Reply With Quote
  #17  
Old 08-30-2001, 05:34 PM
IanMFT IanMFT is offline
 
Join Date: Oct 2001
Location: Long Island, NY
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, something is REALLY screwey, i changed the 0 back to a 1(actually, i re copied the script) and its still displating the last comment instead of the news...this is quite odd. Any ideas?
Reply With Quote
  #18  
Old 08-30-2001, 09:01 PM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I dont get this problem.

Ill look into it, give me a day.
Reply With Quote
  #19  
Old 08-31-2001, 07:36 AM
pier
Guest
 
Posts: n/a
Default

Quote:
Originally posted by IanMFT
ok, something is REALLY screwey, i changed the 0 back to a 1(actually, i re copied the script) and its still displating the last comment instead of the news...this is quite odd. Any ideas?
Yes... same problem there
Reply With Quote
  #20  
Old 08-31-2001, 10:20 AM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That is REALLY strange.

I have this script running, here and it works fine.

Really weird.

Im actually working on another problem atm, so could you pls post a copy of the news.php file in here(just use [php] tags)

Thanks!
Reply With Quote
  #21  
Old 08-31-2001, 04:03 PM
IanMFT IanMFT is offline
 
Join Date: Oct 2001
Location: Long Island, NY
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
<? 
error_reporting(7);
$templatesused='header,newsbit,shownews,headerbit,newsheaders';

//What is the ID of your News forum?

$newsforums = 48;

//How many news items should be displayed?
$newsitems = 10;

//Path to your forums directory (leave out trailing slash), i recomend using [url]http://www.domain.com/forumpath[/url]
$forumspath = "/forums";

require('./global.php');

$newsquery = "SELECT thread.*, post.*";
$newsquery .= " FROM thread,post";
$newsquery .= " WHERE post.threadid=thread.threadid";
$newsquery .= " AND thread.forumid=$newsforums";
$newsquery .= " GROUP BY thread.threadid";
$newsquery .= " ORDER BY thread.dateline DESC";
$newsquery .= " LIMIT $newsitems";

$headlinequery = "SELECT thread.*";
$headlinequery .= " FROM thread";
$headlinequery .= " WHERE forumid = $newsforums";
$headlinequery .= " ORDER BY threadid";
$headlinequery .= " DESC LIMIT $newsitems";

if ($action == "headlines") {$query = $headlinequery;} else {$query = $newsquery;}

$passthruquery=$DB_site->query($query);

while ($newsarray=$DB_site->fetch_array($passthruquery)) {
    //Get date in their timezone
    $dateposted = vbdate("jS F Y, H:i",$newsarray[dateline]);
    //If they select anything but 'headlines' as their action, assume they want news.
    if ($action != "headlines") {
        //You may remove this, and replace any reference to $commenttext in the templates to Coments, or use replacment variables
        //Make it plural if there is more than one comment
        if ($newsarray[replycount]==1) {
            $commenttext = "Comment";
        }
        else {
            $commenttext = "Comments";
        }
            //Process the thread, and make it parse vBcode, and stuff
            $cookedthread=bbcodeparse2($newsarray[pagetext],"1","1","1","1");
            //Call the template 'newsbit' for each news entry it finds in the database
            eval("\$newsbits .= \"".gettemplate("newsbit")."\";");
    }
    //They want headlines, so they get headlines
    if ($action == "headlines") {
        eval("\$newsbits .= \"".gettemplate("headlinebit")."\";");
    }
}

eval("dooutput(\"".gettemplate("shownews")."\");");

?>
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 11:27 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.07068 seconds
  • Memory Usage 2,310KB
  • Queries Executed 25 (?)
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
  • (2)bbcode_code
  • (2)bbcode_php
  • (2)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
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (9)postbit_onlinestatus
  • (11)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
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete