Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 05-18-2009, 03:55 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That would be part of what you would have to add to the mod. You'd probably set a variable which would then turn 'on' the code in the template to make the pop-up. Or something like that.
Reply With Quote
  #12  
Old 05-19-2009, 06:38 AM
powerful_rogue powerful_rogue is offline
 
Join Date: Jan 2007
Location: Kent
Posts: 603
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lynne, This will probably sound like a really stupid question, but im sure it will help me on the right track!

Why would I need to create a template? I thought templates were only used for showing something - SHOWTHREAD, FORUMHOME etc

If you put some code in the SHOWTHREAD, it only works when you visit the SHOWTHREAD page, likewise for other templates. I would have thought the code would need to go in the header/footer or template which show on every page?

Im probably wrong in my logic, but this is a great time to get these mistaken thoughts sorted!
Reply With Quote
  #13  
Old 05-19-2009, 06:47 AM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can also read up on all of these. It helped me out alot
Reply With Quote
  #14  
Old 05-19-2009, 07:02 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by powerful_rogue View Post
Im on the w3schools.com website, any ideas where I should start? Im guessing the following but i maybe wrong!

HTML
XML
Javascript
PHP
SQL
You don't really need XML knowledge unless you're dealing with vBulletin's AJAX, but yes, that's the stuff you'd want to learn.
Reply With Quote
  #15  
Old 05-19-2009, 07:31 AM
powerful_rogue powerful_rogue is offline
 
Join Date: Jan 2007
Location: Kent
Posts: 603
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you everyone.

Lynne, I think we must have had our wires crossed as I now know what you mean! originally I was talking more along the lines of an alert box, however now you mentioned templates Im presuming your talking about an actual pop up window!

Ive just started to have a little play and come across a problem. Ive put the following code into the headinclude template

PHP Code:
<if condition="$post['postcount'] = '5'">
<
script language="JavaScript" type="text/javascript">
window.open("win1.html","Window1",
"menubar=no,width=430,height=360,toolbar=no");
</
script></if> 
However it seems to disregard the =5. Ive got a post count on my test forum of 2000+ and it still shows the pop up.

Ive also tried <5 (less then 5) and yet it still shows, but if I change it to >5 (greater then) it dosent show

Im going to get some sleep as just come off a night shift, then a trip down to the library to get some books out! Ive tried once before to learn, but gave up because I started to get confused, but Im more determined then anything now! I think im going to struggle when it comes to adding fields in the admincp to control the mod, but one step at a time!
Reply With Quote
  #16  
Old 05-19-2009, 02:44 PM
EnIgMa1234 EnIgMa1234 is offline
 
Join Date: Mar 2006
Location: .:: Ireland ::.
Posts: 1,306
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by powerful_rogue View Post
Thank you everyone.

Lynne, I think we must have had our wires crossed as I now know what you mean! originally I was talking more along the lines of an alert box, however now you mentioned templates Im presuming your talking about an actual pop up window!

Ive just started to have a little play and come across a problem. Ive put the following code into the headinclude template

PHP Code:
<if condition="$post['postcount'] = '5'">
<
script language="JavaScript" type="text/javascript">
window.open("win1.html","Window1",
"menubar=no,width=430,height=360,toolbar=no");
</
script></if> 
However it seems to disregard the =5. Ive got a post count on my test forum of 2000+ and it still shows the pop up.

Ive also tried <5 (less then 5) and yet it still shows, but if I change it to >5 (greater then) it dosent show

Im going to get some sleep as just come off a night shift, then a trip down to the library to get some books out! Ive tried once before to learn, but gave up because I started to get confused, but Im more determined then anything now! I think im going to struggle when it comes to adding fields in the admincp to control the mod, but one step at a time!
Change the = to ==.

= is for setting a value to something,
== is for comparison
Reply With Quote
  #17  
Old 05-19-2009, 03:16 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yep, what he said. ^^
Reply With Quote
  #18  
Old 05-19-2009, 04:30 PM
powerful_rogue powerful_rogue is offline
 
Join Date: Jan 2007
Location: Kent
Posts: 603
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Brilliant stuff! Thank you!

Any idea why the below dosent work even though my postcount is greater then 5?

Quote:
<if condition="$post['postcount'] > '5'">
<script language="JavaScript" type="text/javascript">
window.open("win1.html","Window1",
"menubar=no,width=430,height=360,toolbar=no");
</script></if>
however it shows up when I chage it to less then?

Quote:
<if condition="$post['postcount'] < '5'">
<script language="JavaScript" type="text/javascript">
window.open("win1.html","Window1",
"menubar=no,width=430,height=360,toolbar=no");
</script></if>
Reply With Quote
  #19  
Old 05-19-2009, 06:22 PM
EnIgMa1234 EnIgMa1234 is offline
 
Join Date: Mar 2006
Location: .:: Ireland ::.
Posts: 1,306
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by powerful_rogue View Post
Brilliant stuff! Thank you!

Any idea why the below dosent work even though my postcount is greater then 5?



however it shows up when I chage it to less then?
You'll need to use $post[posts]

If you want the current users info and not what ever user posted use this:

Code:
$bbuserinfo[posts]
Reply With Quote
  #20  
Old 05-20-2009, 05:55 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can't do that - "posts" is (most of the time) an already formatted value (i.e. "1,000" instead of "1000"), and therefore, number comparisons will fail.
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 12:52 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.07788 seconds
  • Memory Usage 2,254KB
  • Queries Executed 11 (?)
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
  • (1)bbcode_code
  • (2)bbcode_php
  • (5)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
  • (2)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