Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 10-04-2005, 01:11 AM
Fenriz Fenriz is offline
 
Join Date: Aug 2002
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Views & Replies Count in Last Post box

Hi! Is it possible to make the hack "Views & Replies Count in Last Post box" for the vBulletin 3.5? I have next working code for the 3.0.x:

--------------------------------------------------------------------------

In the includes/functions_forumlist.php find:

$show['lastpostinfo'] = (!$lastpostforum['password'] OR verify_forum_password($lastpostforum['forumid'], $lastpostforum['password'], false));

below that insert:

$tviews = $DB_site->query_first("SELECT views AS tviews, replycount AS treply FROM " . TABLE_PREFIX . "thread WHERE threadid = $lastpostinfo[lastthreadid]");
$forum[tviews] = $tviews['tviews'];
$forum[treply] = $tviews['treply'];

In the forumhome_lastpostby template find:

</div>
</if>

below that insert:

<div class="smallfont" align="$stylevar[center]">
views: $forum[tviews] | replies: $forum[treply]
</div>
Reply With Quote
  #2  
Old 10-04-2005, 01:13 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That is inefficient.
I'd strongly recommend to implement this another way.
Reply With Quote
  #3  
Old 10-04-2005, 09:39 AM
Fenriz Fenriz is offline
 
Join Date: Aug 2002
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This hack works great on my 3.0.9 board http://valhalla.ulver.com , but I need it to be ported to the 3.5 !

KirbyDE, could you help me to find the efficient way?
Attached Images
File Type: jpg 1.jpg (30.9 KB, 0 views)
Reply With Quote
  #4  
Old 10-04-2005, 09:52 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Smth. like this could work:

cache_ordered_forums
PHP Code:
if (THIS_SCRIPT == 'forumdisplay' OR THIS_SCRIPT == 'index')
{
    
$tachyjoin .= " LEFT JOIN " TABLE_PREFIX "thread AS thread ON (thread.threadid=forum.lastthreadid)";
    
$counter_select str_replace(array(', lastpost'', lastposter'', replycount'), array(', forum.lastpost'', forum.lastposter'', forum.replycount'), $counter_select) . ", thread.views AS tviews, thread.replycount AS treplies";

forumbit_display
PHP Code:
$forum['tviews'] = vb_number_format($forum['tviews']));
$forum['treplies'] = vb_number_format($forum['treplies'])); 
Reply With Quote
  #5  
Old 10-04-2005, 02:46 PM
Fenriz Fenriz is offline
 
Join Date: Aug 2002
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

KirbyDE, the first part works, but ..

Quote:
Originally Posted by KirbyDE
forumbit_display
PHP Code:
$forum['tviews'] = vb_number_format($forum['tviews']));
$forum['treplies'] = vb_number_format($forum['treplies'])); 
this second part of the code always calls for error:

Parse error: parse error, unexpected ')' in /home/.../includes/functions_forumlist.php(466) : eval()'d code on line 1
Reply With Quote
  #6  
Old 10-07-2005, 02:28 AM
Fenriz Fenriz is offline
 
Join Date: Aug 2002
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

KirbyDE?
Reply With Quote
  #7  
Old 10-07-2005, 10:10 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, correct the wrong ) in both lines (as told in the error message) and it should work
Reply With Quote
  #8  
Old 10-07-2005, 04:09 PM
Fenriz Fenriz is offline
 
Join Date: Aug 2002
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh Thank you very much! Now it works perfect!
Reply With Quote
  #9  
Old 04-12-2006, 07:48 PM
Fenriz Fenriz is offline
 
Join Date: Aug 2002
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Andreas, in 3.5.4 this hack became buggy.

On my forum http://valhalla.ulver.com/index.php?langid=1 it doesn't show "views: | replies: " in several forums and shows wrong information about quantity in the most forums.

Could you give me a good advise about this code, please?
Reply With Quote
Reply

Thread Tools
Display Modes

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 08:22 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.05068 seconds
  • Memory Usage 2,263KB
  • Queries Executed 14 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (9)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete