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)

Shpookdefied 01-14-2003 03:02 AM

Ok, I haven't installed it in all the template sets. :D I'm gonna go do that now, and I'll let you know how it works. Much respect for the amount of support you've given though.

w596 01-16-2003 06:09 PM

Another AWESOME hack from Logician. :D ;)

Thanks,
w596

Logikos 01-17-2003 01:42 AM

Ok i have installed this hack EXACTLY as instructed.

and im getting this error when trying to load my site




Quote:

Parse error: parse error in /home/hazelboy/public_html/Forums/admin/functions.php on line 855

Fatal error: Call to undefined function: vbdate() in /home/hazelboy/public_html/Forums/admin/sessions.php on line 400

Note: I have installed this on every style.

Any help is greatly appreciated, as this would be a GREAT hack to install.

-Nem

Logician 01-17-2003 10:54 AM

Quote:

Originally posted by []\[]emesis
Ok i have installed this hack EXACTLY as instructed.

and im getting this error when trying to load my site

Your problem is related to STEP 2. Check very carefully, you applied it correctly.

BTW.
Quote:

before ?> add:
means "add one line above ?>", not append.

So after installation if your last line of functions.php became like this:
PHP Code:

// Logician Dynamic Forum Announcements Hack ?> 

This is wrong. It should be like this:
PHP Code:

// Logician Dynamic Forum Announcements Hack 
?> 

More info can be found here

Hope this helps..

Shpookdefied 01-18-2003 06:11 AM

lol Me and Nemesis got it working, Logician. We just installed all the hacks on our PC vbulletin, then uploaded the .php files. Works great, and I love this hack. Thanks!

Buddha 01-30-2003 03:18 PM

logician, i've got a quick question for you. i installed your hack sometime ago, and i love it. i would have loved a nav link instead as well, instead of digging for it in the options, but i did make it bigger, and i'm trying to add a nav link under the announcements that will go to the options page, and i'd like it to go to that section (like an anchored link). it's not working though... keeping in mind that i'm not a coder.

PHP Code:

makenavoption("Dynamic Announcements","options.php?#settinggroup42"); 

i tried adding the session hash to that statement, but it still won't jump to that section of the page, it just goes to the top of the page.

any thoughts?

also, will it interfere with the hack if i add comments to add names in between the statements, so i know who they pertain to?

thanks.

Logician 01-31-2003 08:53 AM

Quote:

i'm trying to add a nav link under the announcements that will go to the options page, and i'd like it to go to that section
Try adding this:
PHP Code:

$options .= "<a href=\"options.php?t=0&s=$session[sessionhash]#settinggroup34\">Dynamic Announcements</a><br>"

;)

Quote:

will it interfere with the hack if i add comments to add names in between the statements
Yep it will..

Buddha 01-31-2003 05:21 PM

hey, thanks a lot... works like a charm... makes it a lot easier to pop to that section and make constant announcements.

thank you.

Bison 02-02-2003 06:31 PM

Thsi is one of the finest hacks available! ;)

SpeedStreet 02-11-2003 07:44 PM

Logician,

GREAT Hack! Only problem I am having, is that if I try entering in HTML code, it will not parse it. I only see my code on the page.

Is there a workaround for this?

Logician 02-12-2003 06:56 PM

Quote:

Originally posted by SpeedStreet
GREAT Hack! Only problem I am having, is that if I try entering in HTML code, it will not parse it. I only see my code on the page.

This should work:

In the hack code, find:
PHP Code:

$matches14[2]=bbcodeparse($matches14[2]); 

Replace it as:
PHP Code:

$matches14[2]=bbcodeparse2($matches14[2],1,1,1,1); 

Enjoy..

Boofo 02-24-2003 02:42 AM

Sinan, if we choose to put the code in the global.php, do we need to use the code for 2,2,8 and above like we did in the index.php (before it was removed) or the code you have in that section (which is the code for 2.2.7 and below)? I am running 2.2.9.

And is it ok to use this AND the Dynamic templates hack together, ir is it redundant to do that? I have them both installed now. ;)

Boofo 02-24-2003 03:19 AM

Quote:

Originally posted by Buddha
hey, thanks a lot... works like a charm... makes it a lot easier to pop to that section and make constant announcements.

thank you.

Where did you add that at and how does the line of code look for that?

Also, you said you made it bigger. How? :)

mehungie2 02-24-2003 05:31 AM

is there a way to have these just show up on individual forums to all users?

Logician 02-24-2003 07:46 AM

Quote:

Originally posted by Boofo
Sinan, if we choose to put the code in the global.php, do we need to use the code for 2,2,8 and above like we did in the index.php (before it was removed) or the code you have in that section (which is the code for 2.2.7 and below)? I am running 2.2.9.

good point.. Yes you have to use the code for 2.2.8 above if you are using vb 2.2.8 or later..

Quote:

And is it ok to use this AND the Dynamic templates hack together, ir is it redundant to do that? I have them both installed now. ;)

they can work together, I have them both installed too... :)

Boofo 02-24-2003 07:51 AM

Thank you, sir. I use the Dynamic templates hack for EVERYTHING now. I'm looking forward to making good use of the one, too. ;)

By the way, is there a way to be able to use the announcements on any page AND the index.php? I know we have to put it in one or the other, but it would be great to be able to use them both places. Do you know what I mean?

One last thing...is there a way to make a link in the left panel that will take you to the bottom of the vbulletin options where the announcement box is straight from that link?

Logician 02-24-2003 07:59 AM

Quote:

Originally posted by Boofo


Where did you add that at and how does the line of code look for that?

right under:

PHP Code:

makenavoption("vBulletin Options","options.php?t=0","<br>"); 

in admin/index.php and don't forget to edit "#settinggroup34" part..

As for making it bigger, check the thread's old posts plz.. I gave the code somewhere in the thread, I can't remember where :)

Logician 02-24-2003 08:04 AM

uh you are replying me faster than I'm replying you lol
Quote:

Originally posted by Boofo
Thank you, sir. I use the Dynamic templates hack for EVERYTHING now. I'm looking forward to making good use of the one, too. ;)

yeah I like the hack much too.. :)

Quote:


By the way, is there a way to be able to use the announcements on any page AND the index.php? I know we have to put it in one or the other, but it would be great to be able to use them both places. Do you know what I mean?

adding the code in global.php should let you use in main page too. In other words adding there means using in any vb page..

Quote:


One last thing...is there a way to make a link in the left panel that will take you to the bottom of the vbulletin options where the announcement box is straight from that link?

replied above.. :)

Boofo 02-24-2003 08:09 AM

Quote:

Originally posted by Logician
uh you are replying me faster than I'm replying you lol


Great minds think alike. LOL

Quote:

adding the code in global.php should let you use in main page too. In other words adding there means using in any vb page..
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. ;)

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. :)

Logician 02-24-2003 08:32 AM

Quote:

Originally posted by mehungie2
is there a way to have these just show up on individual forums to all users?
You can use this hack for this

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. ;)

Logician 02-25-2003 07:32 PM

Quote:

Originally posted by Boofo

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. ;)

Not tested but I guess you can apply bbcodeparse2 to the hack code. Like this:

Replace: (2 instances!)
PHP Code:

$matches14[2]=bbcodeparse(trim($matches14[2])); 

with
PHP Code:

$matches14[2]=bbcodeparse2(trim($matches14[2]),1,1,1,1


Boofo 02-25-2003 07:51 PM

Worked like a charm. Thank you, Sinan! ;)

One last question...all bbcode or html code HAS to be in between the tags, right? You can't do it before and after the tags.

Like this:

Quote:

[[($bbuserinfo[usergroupid]==6)]]<normalfont>
and not like this:

Quote:

<normalfont>[[($bbuserinfo[usergroupid]==6)]]

Logician 02-25-2003 08:01 PM

that's right because the announcement is only the part in-between conditionals. Rest including the conditionals are cut when it is parsed

Boofo 02-25-2003 08:07 PM

Thank you for confirming that for me. Another fantastic hack by the "Great One!" I'm definitely going to have to make a trip back over there one of these days to meet the Master. ;)

Logician 02-25-2003 08:30 PM

thank you for the undue kind words.. :)

Bad Bunny 02-26-2003 06:08 AM

It was a stupid mistake on my poart.
As usual, your hack is awsome. Not that I ever doubted you. heh (Would not have installed it otherwise)

Thanks for all your hard work.

Triade 03-07-2003 07:14 AM

I didn't installed this hack, but i have a question:

How many time the message stay in the user's screen?
I explain: the user see the message, but when it disappear?
There's a time for it or it rest in the page all the time?

Logician 03-07-2003 01:17 PM

Quote:

Originally posted by Triade
I didn't installed this hack, but i have a question:

How many time the message stay in the user's screen?
I explain: the user see the message, but when it disappear?
There's a time for it or it rest in the page all the time?

The announcement is a part of the page (HTML code), not a popup, so it stays there when user loads the main page.

If you want it not displayed anymore, you need to delete/modify it from your Admin CP..

Logician 03-22-2003 12:39 PM

Here is a April Fools Day announcement for people who is using this hack: :rambo:

Enter this announcement in your dynamic announcement box:
Quote:

[[($bbuserinfo[userid]>0 AND date("m-d")=="04-01")]]
[ SIZE=4][ COLOR=red]Our member [ b]$bbuserinfo[username][ /b] has been caught while trying to hack into our site server and we are instituting legal proceedings ASAP. In the mean time please do not contact $bbuserinfo[username], nor reply his posts/pms. Please [ url="http://yoururl/forum/showthread.php?s=&threadid=x"]get more info here now![/ url][ /COLOR][ /SIZE]
[[/($bbuserinfo[userid]>0 AND date("m-d")=="04-01")]]
(Remove spaces in vbcodes and edit XX with a threadid)

You can insert it now, you don't need to wait for April 1st. This announcement will be visible in that day only if visitor is a forum member (it is invisible to guests). Everyforum member will see his name in this announcement and following the link will take them to a thread of your choice. :cool:

Enjoy..

Boofo 03-22-2003 01:03 PM

LOL at Sinan. Getting in to the old April Fool's day spirit already. ;)

Would there be a way to make an addon where you could enter pre-made announcements like this for different days of the year and it could pull it from the db as needed?


All times are GMT. The time now is 02:33 PM.

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.01580 seconds
  • Memory Usage 1,865KB
  • 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
  • (9)bbcode_php_printable
  • (28)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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