vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Dynamic Announcements: Programmable Forum Home Announcement/Message with conditionals (https://vborg.vbsupport.ru/showthread.php?t=43194)

Logician 02-24-2003 09:22 AM

Quote:

Originally posted by Boofo

Ok, but you said the global is called before the index.php. I was referring to the $allpm example you gave above. I would like to be able to do that sort of thing on the index page and still be able to use it elsewhere in the forum. ;)

when you add the code into global.php, the dynamic announcement variable is formed for all vb files that runs (including index.php). Therefore you can use it nearly all vb templates. However if a template is called inside a function (eg. postbit template), then the variable should be declared global or will be blank since functions in PHP does not have global variable scope..


Quote:


And I tried adding that code under the vb options link on the left but it takes me to the top of the vb options listing instead of to bottom of it. And idea how to make it go to the bottom? I did the settinggroup ID but it didn't change it. :)

make sure settinggroupid is belongs to dynamic announcement hack's id and is correct..

Boofo 02-24-2003 09:31 AM

Quote:

Originally posted by Logician

when you add the code into global.php, the dynamic announcement variable is formed for all vb files that runs (including index.php). Therefore you can use it nearly all vb templates. However if a template is called inside a function (eg. postbit template), then the variable should be declared global or will be blank since functions in PHP does not have global variable scope..



This is the message I was referring to.

https://vborg.vbsupport.ru/showthrea...738#post317738

Quote:

make sure settinggroupid is belongs to dynamic announcement hack's id and is correct..
I did that. The settinggroupid is 101 for it in my admin cp and it still stays at the top of the vb options page.

Logician 02-24-2003 10:10 AM

Quote:

Originally posted by Boofo

This is the message I was referring to.

https://vborg.vbsupport.ru/showthrea...738#post317738

I see.. the reason we applied the hack to index.php in that post is because the variable ($allpm) used in the announcement is being assigned a value in index.php. So if you use this announcement in another template which is called in an other .php file but index.php $allpm variable will have no value, thus conditional will prove always FALSE.. To make it run in other templates, you have to hack the .php file where that template is called and assign a value for $allpm variable..

Bad Bunny 02-24-2003 03:13 PM

Hmmm, I finally remembered this hack. Sheesh

Anyway, I have your dynamic templates hack installed, and that works wonderfully, but now I tried toi install this, and it does not seem to be doing anything.

Would the fact that I renamed my index file to forums have anything to do with this? I applied the changes that were for index to my newly named index. If you follow what I mean.

I receive no errors, nothing.
It seems that I could do a similar thing with just modifying the forumhome template using your other hack. So...should I just use one and not both?

Summary:
I have renamed my index, and applied the hack to it. Shouwld this affect the hack adversly?
Are your dynamic announcments and dynamic templates hacks compatible?

Boofo 02-24-2003 07:51 PM

Quote:

Originally posted by Logician

I see.. the reason we applied the hack to index.php in that post is because the variable ($allpm) used in the announcement is being assigned a value in index.php. So if you use this announcement in another template which is called in an other .php file but index.php $allpm variable will have no value, thus conditional will prove always FALSE.. To make it run in other templates, you have to hack the .php file where that template is called and assign a value for $allpm variable..

Ok, I see. Then we either use it one place or the other. I supposed I can use the dynamic templates for the other areas of the site that I can't reach with this if I put it in the index.php. ;)

Logician 02-24-2003 08:02 PM

Quote:

Originally posted by Bad Bunny
I have renamed my index, and applied the hack to it. Shouwld this affect the hack adversly?
Are your dynamic announcments and dynamic templates hacks compatible?

No, your changing the file name wouldnt effect the hack and yes both hacks should work ok together.

Please check :
1- If you have more than 1 template sets, have you created D.Announcement hack template in all sets.
2- Have you clicked SAVE SETTINGS in vb options after installation.
3- If you have a conditional, does it apply when you check it? Or simply remove the conditional and see if it works

Bad Bunny 02-25-2003 03:03 AM

Well, minus the running of the script, I will retry the whole installation.

I know how to apply hacks, and I know you do a great job on hacks, so it must have been somewhere that I messed up in applying it.

I do have a couple styles, but they are forum dependant and not user-selectable.

Boofo 02-25-2003 07:09 PM

I just tried to use the <normalfont> tags in the announcement and it still shows smallfont and the tags themselves. I tried the fix from page nine of this thread and it didn't make any difference. Am I doing something wrong somewhere?

Logician 02-25-2003 07:22 PM

you need to edit that part in the hack's template:

<smallfont>$matches14[2]</smallfont>

Boofo 02-25-2003 07:27 PM

Ahhh, ok. I supposed I should have looked there before I bothered you with this. Sorry about that. :confused:

But there's no way to be able to do it in the announcement itself? That would make it easier if you want to change the size of text on the fly. ;)


All times are GMT. The time now is 07:34 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.01198 seconds
  • Memory Usage 1,746KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete