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
Latest XX Threads on Forumhome Page Details »»
Latest XX Threads on Forumhome Page
Version: 1.00, by TECK TECK is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 09-07-2002 Last Update: Never Installs: 118
 
No support by the author.

This hack will add your latest xx threads to your forum home page.
The good part is that you can do all this with only 1 query.

The following options are available:
- number of threads displayed
- alternating background color (same like the showthread view)
- thread's title (with link)
- thread's title lenght (just in case you use it in a small table)
- thread's icon
- thread's date and time
- thread's starter (with link)
- thread's no. of views
- thread's no. of replies

[high]The hack uses each forum's permissions.[/high]
In other words, if you have a private forum, your private threads will not show unless you have permissions to view them.

ESTIMATED INSTALL TIME: 5 minutes
REQUESTED BY: Nobody
TESTED IN VERSION: 2.2.7

To download the latest version of this hack, click below:

Show Your Support

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

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

use only:
Code:
<smallfont><a href="showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]">$thread[title]</a><br></smallfont>
in whatever table you need.
Reply With Quote
  #33  
Old 10-02-2002, 08:46 PM
Antorz Antorz is offline
 
Join Date: Jan 2002
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

still get the same problem, no change



thx for looking at it...


including a screenshot of the problem below:
Reply With Quote
  #34  
Old 10-04-2002, 12:50 AM
\ \ - Speedy - / /'s Avatar
\ \ - Speedy - / / \ \ - Speedy - / / is offline
 
Join Date: Nov 2001
Location: Speedy's World
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I dont know where to put the $threadbits's in the forumhome thread, I want it like all the rest of the fourms normal have it (to the left side of the forum) how can I do this? look at any of the pictures of this thread to understand what I mean)

~Speedy~

(No one answerd it, my thing is right now under my Authroty List *witch is all the way at the bottom, and dont reply with Anywhere, cuz I cant find anywhere lol
Reply With Quote
  #35  
Old 10-04-2002, 09:57 AM
Pseudomizer's Avatar
Pseudomizer Pseudomizer is offline
 
Join Date: Mar 2002
Location: Germany
Posts: 614
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi @LL,

i need your help please. I installed the hack.
It works fine.

The problem right now is, that the permissions do not have
effect. I did it like described in the text file BUT threads from
our mod forum categorie are listet in the "latest threads" on
our start page even if you are a guest.

I double checked the source code. The old perms in the index.php
are take out with /* bla bla */ and the new source code is in.

Please help me because this is data not defined for our community
posters.

Thanks in advance.

Source Code:

/*
//Forum info
$forums=$DB_site->query('SELECT * FROM forum WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');
while ($forum=$DB_site->fetch_array($forums)) {
$iforumcache["$forum[parentid]"]["$forum[displayorder]"]["$forum[forumid]"] = $forum;
}
$DB_site->free_result($forums);
unset($forum);

//Forum perms
$forumperms=$DB_site->query("SELECT forumid,canview,canpostnew FROM forumpermission WHERE usergroupid='$bbuserinfo[usergroupid]'");
while ($forumperm=$DB_site->fetch_array($forumperms)) {
$ipermcache["$forumperm[forumid]"] = $forumperm;
}
$DB_site->free_result($forumperms);
unset($forumperm);*/

// ################################################## ################################################## ############

// START OF FORUM THREAD HACK

//Forum perms
$forumperms=$DB_site->query("SELECT forumid,canview,canpostnew FROM forumpermission WHERE usergroupid='$bbuserinfo[usergroupid]'");
while ($forumperm=$DB_site->fetch_array($forumperms)) {
$ipermcache["$forumperm[forumid]"] = $forumperm;
}
$DB_site->free_result($forumperms);
unset($forumperm);

//Forum info
$forums=$DB_site->query('SELECT * FROM forum WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');
while ($forum=$DB_site->fetch_array($forums)) {
$iforumcache["$forum[parentid]"]["$forum[displayorder]"]["$forum[forumid]"] = $forum;
if ($ipermcache["$forum[forumid]"]["canview"]==1 || !isset($ipermcache["$forum[forumid]"]["canview"])) {
$iforumperms[] = $forum["forumid"];
}
}
$DB_site->free_result($forums);
unset($forum);

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

//Latest threads
$maxthreads=10; //number of threads
$maxchars=60; //title lenght in characters

$threads=$DB_site->query("SELECT * FROM thread WHERE open='1' AND open<>10 $iforumperms ORDER BY lastpost DESC LIMIT $maxthreads");
while ($thread=$DB_site->fetch_array($threads)) {
$thread['title'] = unhtmlspecialchars($thread['title']);
if (strlen($thread['title']) > $maxchars) {
$thread['title'] = substr($thread['title'], 0, $maxchars - 2) . '...';
}

///////////////////////////////////////////////////////////////////////
// extra options //////////////////////////////////////////////////////

//show icon
if ($thread['iconid'] == 0) {
$thread['icon'] = '<img src="{imagesfolder}/icons/icon1.gif" border="0" align="absmiddle" alt="">';
} else {
$thread['icon'] = '<img src="{imagesfolder}/icons/icon' . $thread['iconid'] . '.gif" border="0" align="absmiddle" alt="">';
}

//show date
$threaddate = vbdate($dateformat, $thread[dateline]);

//show time
$threadtime = vbdate($timeformat, $thread[dateline]);

//alternate colors
$bgrowcolor = rowcolor();

// end extra options //////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////

eval("\$threadbits .= \"".gettemplate('forumhome_threadbits')."\";");
}
$DB_site->free_result($threads);
unset($thread);

// END of Forum THREAD HACK
Reply With Quote
  #36  
Old 10-04-2002, 11:48 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

all i can say is this. the hack is working for me and many others. double check everything.
Reply With Quote
  #37  
Old 10-04-2002, 03:23 PM
Pseudomizer's Avatar
Pseudomizer Pseudomizer is offline
 
Join Date: Mar 2002
Location: Germany
Posts: 614
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi TECK,

your Script does NOT work correctly. This is fact. The problem is,
if you have subcategories which get their permissions from the
parent forumid.

You check if the permission for the usergroup is set to = '1'
or if it is empty.

But what happens if you have the case that you have a
subcategory ( no permissions are set ) which get their
permissions from the parent forumid and in the forum parent
category the permission is set to "0" ???? The User should have
NO ACCESS to the subforum but with your script the user HAVE
access to the subcategory.

It took me more than 6 hours to find a fix for this tricky thing.
But it works now.

Nevertheless, thanks for your quick answer.

Best regards,

Pseudomizer
Reply With Quote
  #38  
Old 10-13-2002, 12:46 AM
croft croft is offline
 
Join Date: Aug 2002
Location: Sweden
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I cant even get this hack to show =( All i get is an error

Parse error: parse error in /home/sites/site159/web/index.php on line 64

I attached the index file to.
Reply With Quote
  #39  
Old 10-13-2002, 10:29 AM
Pseudomizer's Avatar
Pseudomizer Pseudomizer is offline
 
Join Date: Mar 2002
Location: Germany
Posts: 614
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello croft,

please download from http://www.editplus.com the Edit Plus
Text Editor and open your file.

You will see, that this tool recognizes PHP source code and
will highlight different things.

You will find your problem if you look at the green lines. Green
lines should be comments in source code.

In your source 50% is comment due to line errors or { } errors.

Best regards,
Reply With Quote
  #40  
Old 11-04-2002, 01:34 AM
Robert9 Robert9 is offline
 
Join Date: Oct 2001
Location: super
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

would it be possible to add this to say a non-vb page? and if so how would i do that? please pm me how i could do so. Thanks!
Reply With Quote
  #41  
Old 11-16-2002, 01:24 AM
stormcrow stormcrow is offline
 
Join Date: Oct 2002
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How could I add one extra line to each thread display that shows what forum it is in?
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 06:20 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.09955 seconds
  • Memory Usage 2,314KB
  • 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
  • (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
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)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