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
Simple newsportal / thread overview to add to your board... Details »»
Simple newsportal / thread overview to add to your board...
Version: 1.00, by KuraFire KuraFire is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 05-05-2002 Last Update: Never Installs: 54
 
No support by the author.

Okay, this isn't really a hack, since you don't have to modify any vb-files really, but I figured this was the best place to make it public anyhow. I found it rather useful myself, so I figured others might, too.

Last update: April 28th, 2003!
** Update summary: **
The bug that could occur due to MySQL stupidity has been fixed. Version 2 of the Newsportal script is now attached in this post, you can simply overwrite the newsportal.php on your site with the one from the attached zipfile to upgrade.
From now on, no more vB files need to be adjusted nor do you have to make any database changes. If you've already done all that due to the mysql-bug in a previous stage of this hack, you can just leave it like that, it won't do any harm. If you're intent on 'cleaning' your files again, let me know if you can't get it done yourself.


Q&A:
What does this 'hack' do?

http://www.kurafire.com/newsportal.php

That's a live example of the fully functional version of the Hack (version 2). I think it speaks for itself.

The amount of newsposts & threads on the right is set in a variable at the beginning.


Is this hack hard to install?
Absolutely not. You upload the newsportal.php, you add the new templates (see zipfile), and you place a link to newsportal.php wherever you want it on your site. That's it.
You don't have to modify any vB files, nor your database.


Does this hack include my style and everything?
Yes, the newsportal page will use your headinclude, header, footer and style-colors (pagebgcolor, tableouterwidth, linkcolor, etc.) and all these settings are easily configureable. You just edit the templates like you're (hopefully) used to with all the normal vB Templates.


Version 2:
The newsportal script now uses 2 queries to get the necessary information for your News posts. One for all thread info and the postid's of the starting posts, and one for the pagetext (ie. post contents) of all those postid's. You can use 2, 20 or 200 newsposts, that won't matter, it'll always be 2 queries (though I discourage using more than 20 newsposts ). ^_^

That's it, you're all done. Have fun with the newsportal! ^_^

Show Your Support

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

Comments
  #47  
Old 05-08-2002, 06:35 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

kura.. if you have a chance, look at the perms included in the vbHome hack. they work, but perms = alot of queries, as firefly mention it to me earlier. PPN was kind enough to look at my hole file i wrote. i will let you know what he says about the perms, then i will post here the mods PPN did to the code, so you can insert it also in your hack.

team work.
Reply With Quote
  #48  
Old 05-08-2002, 06:52 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

here it is kura, from my file the code that works (thanks PPN):
Code:
// latest threads ***************************
$doperms=$DB_site->query("SELECT canview,forumid FROM forumpermission WHERE usergroupid='$bbuserinfo[usergroupid]'");
while ($doperm = $DB_site->fetch_array($doperms)) {
  $perms["$doperm[forumid]"] = $doperm;
}
$DB_site->free_result($doperms);
unset($doperm);

$forum=$DB_site->query("SELECT forumid FROM forum");
while ($forums=$DB_site->fetch_array($forum)) {
  if($perms["$forums[forumid]"]["canview"] == 1 || !isset($perms["$forums[forumid]"]["canview"])) {
    $forumperms[]=$forums["forumid"];
  }
}
$DB_site->free_result($forum);
unset($forums);

if(!empty($forumperms)) {
  $forumperms='AND forumid='.implode(' OR forumid=',$forumperms);
}

$dothreads=$DB_site->query("SELECT * FROM thread WHERE open=1 AND open<>10 $forumperms ORDER BY lastpost DESC LIMIT 10");
while ($dothread=$DB_site->fetch_array($dothreads)) {
  $dots='';
  if (strlen($dothread[title])>29) {
    $dots='...';
  }
  $forumid=$dothread[forumid];
  $threadid=$dothread[threadid];
  $threadtitle=substr($dothread[title], 0, 32);

  $lastthreadbits .= '<a href="showthread.php?s='.$session[sessionhash].'&forumid='.$forumid.'&threadid='.$threadid.'">'.$threadtitle.$dots.'</a><br>';
}
unset($dothread);
i use this code in corelation with a higly modified forumdisplay.php file. it involved several mods to the tables. but the result is nice, i think:
https://vborg.vbsupport.ru/attachmen...&postid=249059

try the code and let me know what you think. i will update my vbHome hack also. later on today...
Reply With Quote
  #49  
Old 05-08-2002, 09:09 AM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I didn't use your code above nakkid, but I used PPN's new code (his former had a wrong var.name) and it works.

The first post is updated and the hack now includes permissions. Re-download if you have this installed and overwrite newsportal.php and re-set your variables, to include the permission checking (works like a charm! )
Reply With Quote
  #50  
Old 05-08-2002, 09:11 AM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay I just wanna say a big THANK YOU NAKKID for helping me out, sure PPN did the actual code-writing but nakkid pointed me to it and helped out nonetheless. Thanks Nakkid! :up:
Reply With Quote
  #51  
Old 05-08-2002, 10:40 AM
pattox2k1's Avatar
pattox2k1 pattox2k1 is offline
 
Join Date: Jan 2002
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hey kreft on that test forum i like dat avatar............where u got it from???? or could u PLZ pm me it??????
Reply With Quote
  #52  
Old 05-08-2002, 06:44 PM
inetd inetd is offline
 
Join Date: Nov 2001
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Help me!
I don't see changes in "Attachment: newsportal-hack.zip" from first post. :<
Anybody, please attach new newsportal.php. Thx!
Reply With Quote
  #53  
Old 05-08-2002, 07:57 PM
kreftt's Avatar
kreftt kreftt is offline
 
Join Date: Dec 2001
Posts: 121
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it might help to empty your cache in internet explorer and try downloading again...

kreftt
Reply With Quote
  #54  
Old 05-08-2002, 09:50 PM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

or you just use a Real browser and get Mozilla
Reply With Quote
  #55  
Old 05-09-2002, 07:54 AM
Floris Floris is offline
 
Join Date: Jan 2002
Posts: 1,898
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Mozilla is a real browser, but not a final version yet. (just pointing out)

About the different type of "portal" / "cms" scripts that are out now, everybody has written their own, and they have included, excluded several features. This makes it perfect for certain groups. Some do not need the bulk from vBportal and then this is just fine. Also, adding stuff that is missing is a bliss for this script. Others who do not like vBportal can pick vBhome/ vBindex and/or whatever else is out there. It all ends on support/performance/serverload and ease in use. This differs per user. I am happy enough with this one, for it won't be a part of my frontpage.
Reply With Quote
  #56  
Old 05-10-2002, 01:13 AM
Sketch Sketch is offline
 
Join Date: Apr 2002
Location: Baltimore, Maryland
Posts: 135
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So I imagine the original file is now the completely updated and final version of this hack?

Also, can this be used on a non-vb page, such as my home page to the whole site?

Sketch
Reply With Quote
  #57  
Old 05-10-2002, 07:43 AM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, it's not the final version cos this script *still* has that random bug that randomly appears, and takes not the first post out of a thread on your newsforum, but a random post. But it appears not to happen all that frequently, and some people haven't even had it (or just haven't noticed / complained about it ).

This technically _is_ a non-vb page itself. As far as I can see, it won't work if you place it outside your vb folder (where global.php etc. are). It might, but you'll have to adjust the path, for starters. Still not sure it'll work then, you probably have to hardcode the FULL path to functions.php in your global.php first.
Reply With Quote
  #58  
Old 05-11-2002, 06:59 AM
AndyTSJ AndyTSJ is offline
 
Join Date: Feb 2002
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any fix for the bug yet. I'm using the script for news posts and instead of showing the story it is showing a reply instead.
Reply With Quote
  #59  
Old 05-11-2002, 07:59 AM
Floris Floris is offline
 
Join Date: Jan 2002
Posts: 1,898
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

AndyTSJ -- read previous post from Kura, its explained there I think.
Reply With Quote
  #60  
Old 05-11-2002, 09:34 AM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nope, I requested some MySQL-help over at vb.com but nobody has responded, and I don't know how to fix it, either
Reply With Quote
  #61  
Old 05-12-2002, 06:56 AM
AndyTSJ AndyTSJ is offline
 
Join Date: Feb 2002
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Take a look at how it is handled in PluhNews (pluhnews.php) - that script posts the contents of the first post without posting a reply by accident.

You're right though, it doesn't happen all the time.... weird !
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 04:59 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.08900 seconds
  • Memory Usage 2,361KB
  • Queries Executed 30 (?)
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)bbcode_code
  • (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
  • (4)pagenav_pagelink
  • (16)post_thanks_box
  • (16)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (16)post_thanks_postbit_info
  • (15)postbit
  • (16)postbit_onlinestatus
  • (16)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