Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 12-22-2008, 04:34 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If it works, it works! I do not have a copy of vBulletin in front of me right now, so I am not sure if it is the best way. However, there is no need for a product as you have edited the files directly - products deal with plugins, phrases and templates.
Reply With Quote
  #12  
Old 12-22-2008, 11:56 AM
kwblue kwblue is offline
 
Join Date: Jan 2006
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
If it works, it works! I do not have a copy of vBulletin in front of me right now, so I am not sure if it is the best way. However, there is no need for a product as you have edited the files directly - products deal with plugins, phrases and templates.
ok, that makes sense. It does work, but I noticed yesterday that the forum info seems to have disappeared.. .so always says 'Last Post' = Never, 'Threads' = 0, 'Posts' = 0. Not sure why that would have happened.
Reply With Quote
  #13  
Old 12-23-2008, 02:16 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Something must have gone wrong (corrupted cache, maybe). Remove your custom code, and rebuild the cache (Admin CP > Maintenance > Update Counters).
Reply With Quote
  #14  
Old 12-23-2008, 11:21 AM
kwblue kwblue is offline
 
Join Date: Jan 2006
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried to update the counters without removing my code and it didn't seem to help. The query (when I copy it to a query analyzer) runs fine and brings back all the right information as far as lastpostid and all other forum db info.

When I disable my 'plugin code' it works fine... so something has to be happening with my query addition. I am just not sure why yet.
Reply With Quote
  #15  
Old 12-24-2008, 08:33 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Post your snippet of code so I can take a look.
Reply With Quote
  #16  
Old 12-24-2008, 02:42 PM
kwblue kwblue is offline
 
Join Date: Jan 2006
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is the functions.php file code that I added. Quite simple, really, and I highlighted the additions so you can see them quickly:

Code:
		$hook_query_fields = $hook_query_joins = $hook_query_where = '';
		
		
		($hook = vBulletinHook::fetch_hook('cache_ordered_forums')) ? eval($hook) : false;

		// get subscribed forums too
		if ($userid)
		{
			$query = "
				SELECT subscribeforumid, $counter_select $hook_query_fields
					". iif($vbulletin->options['threadmarking'], ', forumread.readtime AS forumread') . "
				FROM " . TABLE_PREFIX . "forum AS forum
				LEFT JOIN " . TABLE_PREFIX . "subscribeforum AS subscribeforum ON (subscribeforum.forumid = forum.forumid AND subscribeforum.userid = $userid)
				" . iif($vbulletin->options['threadmarking'], " LEFT JOIN " . TABLE_PREFIX . "forumread AS forumread ON (forumread.forumid = forum.forumid AND forumread.userid = $userid)") . "
				$tachyjoin
				$hook_query_joins
			";
		}
		// just get counters
		else
		{
			$query = "
				SELECT $counter_select $hook_query_fields
					". iif($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid'], ', forumread.readtime AS forumread') . "
				FROM " . TABLE_PREFIX . "forum AS forum
				" . iif($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid'], " LEFT JOIN " . TABLE_PREFIX . "forumread AS forumread ON (forumread.forumid = forum.forumid AND forumread.userid = " .  $vbulletin->userinfo['userid'] . ")") . "
				$tachyjoin
				$hook_query_joins
			";
		}
	}

It's that simple in the functions file. My plugin is pretty simple too:

Code:
$hook_query_fields = ",`ForumDetails`.`Details_UID`,
`ForumDetails`.`Clean_Name`,
`ForumDetails`.`forumid`,
`ForumDetails`.`Information1`,
`ForumDetails`.`Information2`,
`ForumDetails`.`Information3`"; 

$hook_query_joins = "LEFT JOIN " . TABLE_PREFIX . "ForumDetails ON (ForumDetails.forumid = forum.forumid)";
That's pretty much it. The plugin is tied to: cache_ordered_forums and does allow me to show the 'ForumDetails'.

However - all the stats seem to disappear. They are there and when the query is joined I can see all the same information as I do without the plugin. I ran both queries in an analyzer and the same data is returned in both queries
Reply With Quote
  #17  
Old 12-26-2008, 12:33 PM
kwblue kwblue is offline
 
Join Date: Jan 2006
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I figured it out. It was a query issue. I had 2 forumid's in there and the forumcache script got confused.

Thanks for all your help.
Reply With Quote
  #18  
Old 01-21-2009, 01:22 PM
kwblue kwblue is offline
 
Join Date: Jan 2006
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I thought since this thread is mine... and the next step is pretty similar... I would just continue the post here

Anyway - Now that my homepage is up to date with the proper information.. I want each FORUM to have specific information as well.

I can't, for the life of me, find where to add these same query joins there. Any pointers?
Reply With Quote
  #19  
Old 01-27-2009, 10:29 PM
kwblue kwblue is offline
 
Join Date: Jan 2006
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bumpity bump bump
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 07:51 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.08022 seconds
  • Memory Usage 2,246KB
  • Queries Executed 13 (?)
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
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete