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

Reply
 
Thread Tools Display Modes
  #1  
Old 11-21-2014, 04:58 AM
MyLibary MyLibary is offline
 
Join Date: May 2011
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Forum Blocks Manager "Template to Use" field

Hi guys,
I would like to be able to choose "Template to Use" in forum block manager in
Type "New forum posts" just like in html page.

How can i configure it so i will be able to set "Template to use" in new forum posts too?
Reply With Quote
  #2  
Old 11-21-2014, 09:46 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can't select the template for a "New Posts" block. You can edit or replace the block_newposts template, but that will of course change the template for all "New Posts" blocks you have (if you have more than one).
Reply With Quote
  #3  
Old 11-22-2014, 09:02 AM
MyLibary MyLibary is offline
 
Join Date: May 2011
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If i pay to someone,can he do it?
Like make that option?
Reply With Quote
  #4  
Old 11-22-2014, 10:03 AM
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Posts: 6,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Then you need to post in Requests for Paid Services section if you want to pay someone
Reply With Quote
  #5  
Old 11-22-2014, 10:26 AM
MyLibary MyLibary is offline
 
Join Date: May 2011
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

But is that possible?
Reply With Quote
  #6  
Old 11-22-2014, 11:02 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It is possible. In fact, I don't think it's very difficult. In file includes/block/newposts.php, make this change, around line 81:

Code:
		'datecut' => array(
			'defaultvalue' => 30,
			'displayorder' => 5,
			'datatype'     => 'integer'
		),
		'template' => array(
			'defaultvalue' => 'block_newposts',
			'displayorder' => 6,
			'datatype'     => 'free'
		),
	);
	
	public function getData()

the part in red is added. Note that there's an added comma on the existing line before the added 'template' block.

Then around line 209:
Code:
				// trim the title after fetching the urls
				$postinfo[$key]['title'] = fetch_trimmed_title($post['title'], $this->config['newposts_titlemaxchars']);
			}

			$templater = vB_Template::create($this->config['template']);
				$templater->register('blockinfo', $this->blockinfo);
				$templater->register('posts', $postinfo);
			return $templater->render();
The part in red is changed.

This seems to work but is missing the phrases for the labels on the config page. I'm sure that's just a matter of figuring out what the phrase name should be. Also if you have existing new posts blocks I'm not sure if they'll get the default value. They may disappear until you edit them and save them with a template name in the new field.
Reply With Quote
  #7  
Old 05-22-2015, 03:03 PM
MyLibary MyLibary is offline
 
Join Date: May 2011
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That should work but in the
admincp/index.php?loc=plugin.php%3Fdo%3Dproduct

There is no option to set a template, can someone assist further?
Reply With Quote
  #8  
Old 05-22-2015, 03:25 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do you mean when you want to actually set the template used by a New Forum Posts block? Then you'd go to Forums & Moderators > Forum Blocks Manager, and when you add or edit a New Forum Posts block you should see a field for template name. But as I mentioned above, you won't see it labled unless you also created the appropriate phrases (and I was too lazy to figure out what they should be named when I wrote that post).

Edit: oh, I see now that you're the one who originally asked the question, and it sounds like you understood this already. So maybe I don't understand the question.
Reply With Quote
  #9  
Old 05-23-2015, 09:25 AM
MyLibary MyLibary is offline
 
Join Date: May 2011
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, now i absolutely understand, but when i ask people for a quote it goes to $150 and i wonder if someone can help or should i go and pay that much?
Reply With Quote
  #10  
Old 05-23-2015, 09:29 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you tried to do the changes above? I think that's most of it, unless I didn't understand what you wanted.
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 12:45 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.04043 seconds
  • Memory Usage 2,248KB
  • 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)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
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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