vb.org Archive

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

yesfans 04-19-2005 01:08 PM

thanks

yesfans 04-19-2005 04:21 PM

Well once I got help figuring out how to put in my addy as asked above this hack went right in, and worked right away. If this stupid arse can do this, any of you reading this can.

GREAT HACK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!

yesfans 04-19-2005 05:10 PM

How can I get my Wife on my site to see mutli messages via the pop up? I did one for user group 2 which she is in and one for her ID, she only saw the useer Group pop up. How can she see both?

femsawyer 04-21-2005 08:57 PM

I'm having problems understanding the conditionals (ie. where [brackets], (parenthesis) and "quotes" go).

Here's what I'm trying to do:
I want to set up a new message for every day of the month for certain usergroups. They are actually going to be download links and they need to be replaced each night at midnight.

Here's what I've tried and it didn't work and I can't figure out why.

[[($bbuserinfo[usergroupid]==2 OR $bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==7 OR $bbuserinfo[usergroupid]==9 OR $bbuserinfo[usergroupid]==10) AND date("m.d.Y")=="04.21.2005")]]Daily Download Link[[/($bbuserinfo[usergroupid]==2 OR $bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==7 OR $bbuserinfo[usergroupid]==9 OR $bbuserinfo[usergroupid]==10) AND date("m.d.Y")=="04.21.2005")]]

I realize that I would have to basically repeat the set of conditionals changing the date section for every day of the month - but I can't even get this to show up for today - so where is my error?

Thanks

Logician 04-22-2005 04:22 AM

Quote:

Originally Posted by femsawyer
I'm having problems understanding the conditionals (ie. where [brackets], (parenthesis) and "quotes" go).

Here's what I'm trying to do:
I want to set up a new message for every day of the month for certain usergroups. They are actually going to be download links and they need to be replaced each night at midnight.

Here's what I've tried and it didn't work and I can't figure out why.

[[($bbuserinfo[usergroupid]==2 OR $bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==7 OR $bbuserinfo[usergroupid]==9 OR $bbuserinfo[usergroupid]==10) AND date("m.d.Y")=="04.21.2005")]]Daily Download Link[[/($bbuserinfo[usergroupid]==2 OR $bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==7 OR $bbuserinfo[usergroupid]==9 OR $bbuserinfo[usergroupid]==10) AND date("m.d.Y")=="04.21.2005")]]

I realize that I would have to basically repeat the set of conditionals changing the date section for every day of the month - but I can't even get this to show up for today - so where is my error?

Thanks

Try this:

PHP Code:

[[(($bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==10) AND (date("m.d.Y",time())=="04.22.2005"))]]

Daily Download Link

[[/(($bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==10) AND (date("m.d.Y",time())=="04.22.2005"))]] 

Tested and works.

femsawyer 04-22-2005 11:07 AM

Quote:

Originally Posted by Logician
Try this:

PHP Code:

[[(($bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==10) AND (date("m.d.Y",time())=="04.22.2005"))]]

Daily Download Link

[[/(($bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==10) AND (date("m.d.Y",time())=="04.22.2005"))]] 

Tested and works.


Thank you so much!!! I appreciate the quick reply!

vau7 04-24-2005 11:56 AM

Hi,

this is very usefull! I love this Hack.

My Problem: I 've done step for step, i have the option in the menu i can save a message but nothing changes!

I use 3.07. There is no change and i double-checked all steps now.

Logician 04-24-2005 03:45 PM

Quote:

Originally Posted by vau7
Hi,

this is very usefull! I love this Hack.

My Problem: I 've done step for step, i have the option in the menu i can save a message but nothing changes!

I use 3.07. There is no change and i double-checked all steps now.

Make sure you've done template changes all ok (newly created templates and modifications in existing templates like forum home). Also make sure you did the changes in ALL template sets available.

steadicamop 04-25-2005 05:34 PM

WONDERFUL HACK!! I was looking for something to show messages direct on the forum home page, this is perfect, and seriously configurable -although Firefox does have issues with the popup, but in IE it's fine.

*Clicks install!

Jason

yesfans 04-29-2005 08:19 PM

YEa I have had a Firefox user complain!

yesfans 04-29-2005 08:26 PM

I have a problem in that I loaded this hack to all my SKINS and it is ONLY working on one, #7. I just went thru all the code agaig, can't find the issue. I assume it has to be in my Forum home or the 3 templates that is causin gthis issue. Log onto my site, www.yesfans.com and see if you can HELP.

IceBurn3000 04-30-2005 03:09 AM

This may seem like a dumb thing to say.. but I cant find the zip of this hack to download... Where is it?

Adrian Schneider 04-30-2005 03:13 AM

Dynamic Forum Home Announcements Hack VB3.txt :)

T3MEDIA 05-01-2005 10:08 AM

Quote:

Originally Posted by Logician
Thanks for the nice message. I try to help out as much as I can. I wish I had more free times at my hands to help more but this is all I can spare. :)

Yeah honestly your a nice guy... Thank you as well.

T3MEDIA 05-01-2005 10:14 AM

I havea question how do you do a else statement with these conditionals?
if this is this way....
do this...
else
do this...

I only want it do do the second part if the first if false.
not sure how to do that.

Logician 05-01-2005 10:36 AM

Quote:

Originally Posted by T3MEDIA
I havea question how do you do a else statement with these conditionals?
if this is this way....
do this...
else
do this...

I only want it do do the second part if the first if false.
not sure how to do that.

You can use a "NOT" "(!)" conditional to simulate <else />.

Eg.

[[($bbuserinfo[userid]>0)]]
if visitor is a member
[[/($bbuserinfo[userid]>0)]]

[[(!($bbuserinfo[userid]>0))]]
if visitor is NOT a member
[[/(!($bbuserinfo[userid]>0))]]

Please note the location of ! and double paranthesis in the second clause
/(!( condition ))

BOWZONE 05-01-2005 09:48 PM

Great hack. Went in on the 1st try with no problems in V3.0.7

Thank you.

Installed!

92GreenGT 05-02-2005 02:38 AM

Can you change color of the pop ups? Also, can you make it where only "Unregistered" users will see it? Thanks

Logician 05-02-2005 08:44 AM

Quote:

Originally Posted by 92GreenGT
Can you change color of the pop ups? Also, can you make it where only "Unregistered" users will see it? Thanks

Please read the thread. Several times asked and answered.

T3MEDIA 05-02-2005 02:35 PM

Quote:

Originally Posted by Logician
You can use a "NOT" "(!)" conditional to simulate <else />.

Eg.

[[($bbuserinfo[userid]>0)]]
if visitor is a member
[[/($bbuserinfo[userid]>0)]]

[[(!($bbuserinfo[userid]>0))]]
if visitor is NOT a member
[[/(!($bbuserinfo[userid]>0))]]

Please note the location of ! and double paranthesis in the second clause
/(!( condition ))

Gotcha! Thank you.

asianboi 05-02-2005 03:02 PM

is there a way to make the close this window button to work?

92GreenGT 05-02-2005 06:32 PM

Quote:

Originally Posted by Logician
Please read the thread. Several times asked and answered.

I did, thanks man for the great mod. I got everything I wanted to know out of the thread. :nervous: Thanks again for the mod.

yesfans 05-02-2005 07:28 PM

Can anyone help me figure out why it is showing up on my style set 7 on www.yesfans.com and not the others. I have everything set up right, can't find it.

Billspaintball 05-03-2005 12:39 PM

I cant believe that I havent stumbled accross this hack before.

Excellent!!!

Consider it Installed :D

Samira 05-05-2005 03:26 AM

Quote:

Originally Posted by greenhybrid
Mine flipped out on the very first step by throwing up an unexpected ] on the following line:

PHP Code:

            $xml .= "\t<setting varname=\"$set[varname]\" displayorder=\"$set[displayorder]\"" iif($set['advanced'], '],'],' advanced="1"') . ">\r\n"


Ditto. That line wasn't touched, any suggestions?

BfB 05-09-2005 04:13 AM

Logician,

Excellent hack! I do appreciate it very much. I installed it on 3.0.3, and it works like a charm.

However, I do have one question, and please do forgive me for possibly repeating something another may have already asked (we're up to 26 pages now, and it is quite tedious to scroll through every single page):

Q: How do you keep the popup within the viewing screen of the browser for when you scroll, so as not to allow it to disappear?

Thanks in advance!

Sincerely,

James

Imperial Fritz 05-09-2005 05:08 AM

How can I show different messages to people with different board languages?

David_R 05-15-2005 07:24 PM

Quote:

Originally Posted by Logician
Not tested, should work:
Apply STEP 5 like this: (btw dont forget to revert your old step 5 installation first! That is remove the hack in step 5 from index.php before applying this)

STEP 5- Edit global.php (in forum main directory), find

PHP Code:

// parse headinclude, header & footer 


REPLACE IT AS:
PHP Code:


// Logician Hack: Dynamic Forum Announcements Hack
if ($vboptions['dynamic_fha'] OR $vboptions['dynamic_popup']) {require_once('./includes/functions_bbcodeparse.php');}

if (
$vboptions['dynamic_fha'])
{
eval(
'$dynamic_fha = "' addslashes($vboptions['dynamic_fha']) . '";'); 
$dynamic_fha=str_replace("\\'""'"$dynamic_fha);
$dfh_announcement_announcementtopaste dynamic_a($dynamic_fha);
if (
trim($dfh_announcement_announcementtopaste)) {eval('$dfh_announcement = "' fetch_template('dfh_announcement') . '";');}
}

if (
$vboptions['dynamic_popup'])
{
eval(
'$dynamic_popup = "' addslashes($vboptions['dynamic_popup']) . '";'); 
$dynamic_popup=str_replace("\\'""'"$dynamic_popup);
$dfh_announcement_popuptopaste dynamic_a($dynamic_popup);
if (
trim($dfh_announcement_popuptopaste)) 
    {
    eval(
'$dfh_announcement_headercode = "' fetch_template('dfh_announcement_headercode') . '";');
    eval(
'$dfh_announcement_popup = "' fetch_template('dfh_announcement_popup') . '";');
    }
}

// Logician Hack: Dynamic Forum Announcements Hack
// parse headinclude, header & footer 

find:

PHP Code:

// if we are in a message editing page then get the editor templates 

Replace it AS:

PHP Code:

// Logician Hack: Dynamic Forum Announcements Hack
$globaltemplates[] = 'dfh_announcement';
$globaltemplates[] = 'dfh_announcement_headercode';
$globaltemplates[] = 'dfh_announcement_popup';
// Logician Hack: Dynamic Forum Announcements Hack
// if we are in a message editing page then get the editor templates 

Upload the file.

Now put
$dfh_announcement_headercode
$dfh_announcement_popup
$dfh_announcement
variable in any template you like.

I found a small problem here. If post caching is enabled it screws my thread display with content of forum annoucement

I am forced to place this in forumshome only :(
do you got any idea, why it screws the showthread content display of first post in a thread when applied on header ?

thanks.

agiacosa 05-28-2005 10:28 AM

I need to present an announcement to my mods that have been inactive. Therefore, I want to show this announcement to usergroup 7 who have posted less than 10 posts in the last two weeks.

Can someone please help me with the conditionals that would be needed to achieve the above?

Thanks.

Divokymuz 06-09-2005 10:33 AM

i use the hack in different forums. it is realy great.

but i got one problem.

when i install a forum, i import a style, which i produced before in a testforum.
if you then did not make the announcement hack, and import the style as second, you geht a database error, if you try to do the addsettings.

is there anyone, who has an idea, to solve this problem ?

illPhever 06-10-2005 05:26 PM

logician,

thanks for this hack. i just installed it and it works great. it is very handy! this is the kind of thing that should come standard in vb.

AaronFry 07-07-2005 12:52 AM

awesome! thanks for the great hack!

EFairy 08-01-2005 02:52 AM

Thank you very much, I love it!

Antivirus 08-20-2005 03:00 PM

Logician,
Great hack, this feature should be standard on all vB upgrades, i was using this previously, however now that we're testing 3.5 rc2, i was wondeiring if you were working on a ported version for 3.5, for eventual release?

acidkid00 08-23-2005 09:29 PM

great hack... installed.. thanks

pgowder 08-31-2005 12:59 PM

I'm trying to have a different header/footer for certain templates. Can this hack do this??

Logician 08-31-2005 01:14 PM

Quote:

Originally Posted by pgowder
I'm trying to have a different header/footer for certain templates. Can this hack do this??

no.. but what you wanted can be achieved this way:

make a copy of these lines in global.php:

PHP Code:

eval('$header = "' fetch_template('header') . '";');
eval(
'$footer = "' fetch_template('footer') . '";'); 

Like
PHP Code:

eval('$header = "' fetch_template('header') . '";');
eval(
'$footer = "' fetch_template('footer') . '";');
eval(
'$header2 = "' fetch_template('header2') . '";');
eval(
'$footer2 = "' fetch_template('footer2') . '";'); 

find :
PHP Code:

    // the really important ones
    
'header',
    
'footer'

and replace it as
PHP Code:

    // the really important ones
    
'header',
    
'footer',
             
'header2',
    
'footer2'

Then user $header2 and $footer2 in anytemplate you like.

CyberRanger 09-01-2005 01:54 PM

Can the conditionals be used to only show the announcement in a certain forum? For example, we have an "Off Topic" area (f=161) where I'd like the announcement to show there but not in other forums. (I have changed the code so that the announcement is part of the header).

Thanks!

Logician 09-01-2005 02:04 PM

Quote:

Originally Posted by westpointer
Can the conditionals be used to only show the announcement in a certain forum? For example, we have an "Off Topic" area (f=161) where I'd like the announcement to show there but not in other forums. (I have changed the code so that the announcement is part of the header).

Thanks!

not tested personally, but I believe this should work in your case:

[[($forumid==161 OR $f==161)]]
...
[[/($forumid==161 OR $f==161)]]

CyberRanger 09-01-2005 02:31 PM

Quote:

Originally Posted by Logician
[[($forumid==161 OR $f==161)]]
...
[[/($forumid==161 OR $f==161)]]

Thanks! I did need to take out the $f==161 then it worked great!


All times are GMT. The time now is 07:45 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.01754 seconds
  • Memory Usage 1,873KB
  • 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
  • (11)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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