vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Dynamic Announcements: Programmable Forum Home Announcement/Message with conditionals (https://vborg.vbsupport.ru/showthread.php?t=97073)

istvan 09-27-2006 09:28 AM

doesnt work ->
[[($bbuserinfo[usergroupid]==10)]]testmessage[[/($bbuserinfo[usergroupid]==10)]]

does work ->
testmessage

so i cant get an message to show for usergroups... Is it so that it only checks on primarygroups?

istvan 09-30-2006 10:34 AM

Quote:

Originally Posted by istvan
doesnt work ->
[[($bbuserinfo[usergroupid]==10)]]testmessage[[/($bbuserinfo[usergroupid]==10)]]

does work ->
testmessage



so i cant get an message to show for usergroups... Is it so that it only checks on primarygroups?

/bump :)

tqvn2004 10-08-2006 09:15 PM

For those who have problem with closing the announcement popup, do the following:

Edit FORUMHOME template, find: (if you have more than 1 template set apply this to all sets)

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
$dfh_announcement_headercode
</head>
<body>
$dfh_announcement_popup
$header
$navbar
$dfh_announcement
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Replace by:

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
</head>
<body>
$dfh_announcement_headercode
$dfh_announcement_popup
$header
$navbar
$dfh_announcement
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

This should do the trick!

===============================================

@Logician: I think it better to embed the announcement popup's closing script in the "dfh_announcement_popup" template, for example:

Code:

<script>function clearpopupannouncement(id) {document.getElementById(id).style.display = 'none';}</script>

<DIV ID="ANNLAYER" STYLE="background-color: red; position: absolute; margin-left:5; margin-right:5; margin-top:5; margin-bottom:0; top: 50px; bottom: 50px; padding: 10px; overflow: auto; border-color: 000000; border-style: solid; border-top-width: 2px; border-right-width: 3px; border-bottom-width: 3px; border-left-width: 2px;">

<table cellpadding="1" cellspacing="0" border="0" class="tborder" width="100%" height="100%" align="center"><tr><td>
    <table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" height="100%">
    <tr height="100%">
            <td class="panelsurround" align="center" height="100%">
      <div class="panel"><div align="$stylevar[left]">

$dfh_announcement_popuptopaste

<br /><br />

<input type="button" onclick="clearpopupannouncement('ANNLAYER')" name="clear" value="$vbphrase[closeannouncement]" class="button">
<br />

</div></div>
        </td>
</tr>
</table>
</td></tr></table>
</div>

By this you dont have to define and calling other template, "dfh_announcement_headercode" :D

PS: Actually you can put 3 templates into one :D

Bulent Tekcan 10-23-2006 08:46 AM

The anouncment screen very BIG Firefox and IE7,it is very bad view.

Any fix for that ?

Thanks

Bubble #5 12-02-2006 09:16 PM

Quote:

Originally Posted by paul41598 (Post 1043616)
What if I want two popups?

I think that's its only drawback ;)

Bulent Tekcan 12-13-2006 09:53 AM

Quote:

Originally Posted by Bulent Tekcan (Post 1102636)
The anouncment screen very BIG Firefox and IE7,it is very bad view.

Any fix for that ?

Thanks

Any idea for this problem ?

Cooleyvol 12-22-2006 10:08 PM

OK, I'm not understanding the time settings.
I've done the change so that you can set it to minutes.

When I set any variable >0, the box doesnt show up.

If I set negative integers, it does.

What is the setting for 15 minutes?

-0.25?

Logician 12-23-2006 08:21 AM

Quote:

Originally Posted by Cooleyvol (Post 1143708)
OK, I'm not understanding the time settings.
I've done the change so that you can set it to minutes.

When I set any variable >0, the box doesnt show up.

If I set negative integers, it does.

What is the setting for 15 minutes?

-0.25?

Numbers should be positive.

The box normally shows up but it does not show up for you because you visited the board in the last 15 minutes (while setting this setting). Log out and wait for 20 minutes, then revisit the board and you'll see that it will show up.

Logician 12-23-2006 08:26 AM

Quote:

Originally Posted by Bulent Tekcan (Post 1102636)
The anouncment screen very BIG Firefox and IE7,it is very bad view.

Any fix for that ?

Thanks

Sorry HTML is not my strong point but if you have a design related problem in popup announcement, you can edit template "dfh_announcement_popup" and play with the setting of the DIV style here:

PHP Code:

<DIV ID="ANNLAYER" STYLE="background-color: red; position: absolute; margin-left:5; margin-right:5; margin-top:5; margin-bottom:0; top: 50px; bottom: 50px; padding: 10px; overflow: auto; border-color: 000000; border-style: solid; border-top-width: 2px; border-right-width: 3px; border-bottom-width: 3px; border-left-width: 2px;"


Cooleyvol 12-23-2006 02:56 PM

Quote:

Originally Posted by Logician (Post 1143892)
Numbers should be positive.

The box normally shows up but it does not show up for you because you visited the board in the last 15 minutes (while setting this setting). Log out and wait for 20 minutes, then revisit the board and you'll see that it will show up.


So the setting for 15 minutes is '15?

If that's the case, how many times does it show during that 15 minutes. Am I correct in thinking that with a setting of '15' that the box will show up for userX for 15 minutes after his first visit to the forums following my setting up of the popup?

If that is incorrect, how can I set it to show up only one time per user OR to show up for the 15 minutes following their first visit? I don't want it to continue popping up for UserX for more than 15 minutes past his first visit after I set it up.

Raptor 01-10-2007 04:22 PM

Quote:

Originally Posted by Logician (Post 1143893)
Sorry HTML is not my strong point but if you have a design related problem in popup announcement, you can edit template "dfh_announcement_popup" and play with the setting of the DIV style here:

PHP Code:

<DIV ID="ANNLAYER" STYLE="background-color: red; position: absolute; margin-left:5; margin-right:5; margin-top:5; margin-bottom:0; top: 50px; bottom: 50px; padding: 10px; overflow: auto; border-color: 000000; border-style: solid; border-top-width: 2px; border-right-width: 3px; border-bottom-width: 3px; border-left-width: 2px;"


Can someone post a fix for this (IE7) - I cant get anything to work no matter what I tweak ?

Xoligy 01-10-2007 07:05 PM

I'm now going to take a look, I should have it fixed in an hour max.

Raptor 01-10-2007 07:35 PM

OK a friend (Xoligy) fixed the code for me so the pop is perfect in IE6, IE7 and Firefox :)

here's the code for dfh_announcement_popup

Code:

<div id="ANNLAYER" style="background-color: red; overflow: auto; position: absolute; margin-left:5; margin-right:5; margin-top:5; margin-bottom:0;  top:33%; left:12%; height: auto; width:75%; padding: 10px; border-color: 000000; border-style: solid; border-top-width: 2px; border-right-width: 3px; border-bottom-width: 3px; border-left-width: 2px;">

<table cellpadding="1" cellspacing="0" border="0" class="tborder" width="100%" height="50%" align="center"><tr><td>
<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" height="100%">
<tr>
        <td class="panelsurround" align="center">
        <div class="panel"><div align="$stylevar[left]">

$dfh_announcement_popuptopaste

<br /><br />

<input type="button" onclick="clearpopupannouncement('ANNLAYER')" name="clear" value="$vbphrase[closeannouncement]" class="button">
<br />

</div></div>

</div></div>
        </td>
</tr>
</table>
</td></tr></table>

</div>


Logician 01-11-2007 07:03 AM

Quote:

Originally Posted by Raptor (Post 1155703)
OK a friend (Xoligy) fixed the code for me so the pop is perfect in IE6, IE7 and Firefox :)

Thanks for the fix! I've updated the hack xml too..

Bulent Tekcan 01-11-2007 05:56 PM

Great news....thanks for that ;)

jazde86 01-13-2007 08:33 PM

Please update the version number and put in the links to check for an update, thanks!

taydu 01-14-2007 07:00 AM

I just update and still get the very big popup, please see attachment, how can I make the popup match with size of the text area like the second picture form Logician

Logician 01-14-2007 08:08 AM

Quote:

Originally Posted by taydu (Post 1158660)
I just update and still get the very big popup, please see attachment, how can I make the popup match with size of the text area like the second picture form Logician

You must have changed the template manually so reinstalling does not overwrite it. Apply the change here:
https://vborg.vbsupport.ru/showpost....&postcount=333

taydu 01-16-2007 01:47 AM

i won't let me reinstalled without overwriting it

OmniBuzz 01-24-2007 02:30 PM

Amazing mod !
Thanks a LOT.

============
Ok one question : How do I set a condition to have a message to be displayed only once per user ?

lazydesis 01-29-2007 01:58 PM

hello :) could someone help me with the conditionals ..so that the message pops up only for users who have not voted on a poll? for eg. say pollid=10

thanx

Logician 01-29-2007 07:07 PM

Quote:

Originally Posted by lazyindian (Post 1169813)
hello :) could someone help me with the conditionals ..so that the message pops up only for users who have not voted on a poll? for eg. say pollid=10

thanx

this wouldn't be possible with this hack, sorry..

taydu 02-05-2007 02:12 AM

For those who wanted to have the pop up static try the following (I just copy & paste some code from dynamic drive. I'm not really good with coding so if anyone can please clean up the code.)

1. Find dhf_announcement_popup

2. Add to top
Code:

<div id="topbar">
3. Add to bottom
Code:

</div>
4. Open the header include template

5. Add to bottom
Code:

<style type="text/css">

#topbar{
position:absolute;
width: 620px;
visibility: hidden;
z-index: 100;
}

</style>

<script type="text/javascript">

/***********************************************
* Floating Top Bar script- ? Dynamic Drive (www.dynamicdrive.com)
* Sliding routine by Roy Whittle (http://www.javascript-fx.com/)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var persistclose=0 //set to 0 or 1. 1 means once the bar is manually closed, it will remain closed for browser session
var startX = 30 //set x offset of bar in pixels
var startY = 5 //set y offset of bar in pixels
var verticalpos="fromtop" //enter "fromtop" or "frombottom"

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function closebar(){
if (persistclose)
document.cookie="remainclosed=1"
document.getElementById("topbar").style.visibility="hidden"
}

function staticbar(){
        barheight=document.getElementById("topbar").offsetHeight
        var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
        var d = document;
        function ml(id){
                var el=d.getElementById(id);
                if (!persistclose || persistclose && get_cookie("remainclosed")=="")
                el.style.visibility="visible"
                if(d.layers)el.style=el;
                el.sP=function(x,y){this.style.left=x+"px";this.style.top=y+"px";};
                el.x = startX;
                if (verticalpos=="fromtop")
                el.y = startY;
                else{
                el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
                el.y -= startY;
                }
                return el;
        }
        window.stayTopLeft=function(){
                if (verticalpos=="fromtop"){
                var pY = ns ? pageYOffset : iecompattest().scrollTop;
                ftlObj.y += (pY + startY - ftlObj.y)/8;
                }
                else{
                var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
                ftlObj.y += (pY - startY - ftlObj.y)/8;
                }
                ftlObj.sP(ftlObj.x, ftlObj.y);
                setTimeout("stayTopLeft()", 10);
        }
        ftlObj = ml("topbar");
        stayTopLeft();
}

if (window.addEventListener)
window.addEventListener("load", staticbar, false)
else if (window.attachEvent)
window.attachEvent("onload", staticbar)
else if (document.getElementById)
window.onload=staticbar
</script>


bts420 02-14-2007 03:22 PM

I've installed the script unfortunately when I use the popup announcement, pressing the close button does not close the popup. Anyone else having this problem?

voteforbird 02-14-2007 08:11 PM

Would this be the correct code for a member who visited within the last 7 days, joined at least 2 weeks ago and is not a member of group 27? This is to combined with "do not display for 720 hours" as a donate reminder every month.:
PHP Code:

[[!($bbuserinfo[lastvisit]
AND 
$bbuserinfo[lastvisit]<strtotime(-7 days))
AND 
is_member_of($bbuserdata['usergroupid'],27)
AND 
$bbuserinfo[joindate]>strtotime("-2 weeks")]]
Text
[[/($bbuserinfo[lastvisit]
AND 
$bbuserinfo[lastvisit]<strtotime(-7 days))
AND 
is_member_of($bbuserdata['usergroupid'],27)
AND 
$bbuserinfo[joindate]>strtotime("-2 weeks")]] 


voteforbird 02-14-2007 08:25 PM

Also, is the hours timer cookie or db-based?

voteforbird 02-19-2007 11:34 PM

Anyone?

voteforbird 03-16-2007 08:51 PM

Is there no support for this add-on?

It seems that whenever I use the timer setting, it simply doesn't show at all.

monasa 04-03-2007 06:36 PM

Im beginner user of VB 3.6.5 and interested to integrate DFHA to my forum. However still cant figure out what does this mean in installation instructions,

2- Edit forumhome/forumhome template and find:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
</head>
<body>
$header
$navbar
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Please guide me on these :-
Where does this forumhome/forumhome template located?
What files should I modify?

Your help much appreciated.

monasa 04-03-2007 08:38 PM

Quote:

Originally Posted by monasa (Post 1219228)
Im beginner user of VB 3.6.5 and interested to integrate DFHA to my forum. However still cant figure out what does this mean in installation instructions,

2- Edit forumhome/forumhome template and find:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
</head>
<body>
$header
$navbar
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Please guide me on these :-
Where does this forumhome/forumhome template located?
What files should I modify?

Your help much appreciated.

found it myself

otto 05-03-2007 05:40 AM

Hi,

and sorry for my bad english ...

I search the conditionals for :

"today is X, hour is between Y and Z, day is wednesday, month is Y, week is month's 2nd week, "

Please help. Thanks!

Bulent Tekcan 05-03-2007 08:43 AM

Hello Logician

Is it possible this announcment special forum ? For example only ForumID 4,5,8 or what ever.

Thanks

Bulent Tekcan 05-14-2007 06:19 AM

Quote:

Originally Posted by Bulent Tekcan (Post 1240453)
Hello Logician

Is it possible this announcment special forum ? For example only ForumID 4,5,8 or what ever.

Thanks

***Bump***

atropos4 05-20-2007 09:21 PM

/me clicks install

This may be just what I am looking for!

EDIT:
Exactly what i was looking for!
thank you!

RaidenDAWG2 05-23-2007 07:31 PM

Quote:

Originally Posted by Bulent Tekcan (Post 1240453)
Hello Logician

Is it possible this announcment special forum ? For example only ForumID 4,5,8 or what ever.

Thanks

Do a condition based on the variable $forumid if you're using the hack to make the thing display on all vB pages, so something along the lines of...

Code:

[[($forumid == 4)]]Your message here...[[/($forumid==4)]]
Where your forum's id is 4 obviously...

Or, if you wanted to do more than one forum...

Code:

[[(in_array($forumid, array(5,6,7))]]Your message here...[[/(in_array($forumid, array(5,6,7))]]
Where array(5,6,7) would refer to forums with id's 5,6, and 7. Or whatever you prefer there. The form is basically a comma separated list with no spaces for in_array.

I've not tested those exactly, but my understanding of where that hook is located is that you should have access to the $forumid variable from global.php, which should be what you'd need to do it.

-RD

Bulent Tekcan 05-24-2007 07:50 AM

Aha it is worked :)

But your code include 2 extra space.

[[($forumid == 4)]]Your message here...[[/($forumid==4)]]

Working Code

[[($forumid==4)]]Your message here...[[/($forumid==4)]]

Thanks for great post.

Bulent Tekcan 05-25-2007 11:57 AM

I find a problem today.If I use this conditional User Notes is not working.When I press Post Notes or View Notes this error occured.Every user same thing

"No User specified. If you followed a valid link, please notify the administrator"

Any idea for this ?

Bulent Tekcan 06-11-2007 03:13 PM

Quote:

Originally Posted by Bulent Tekcan (Post 1254425)
I find a problem today.If I use this conditional User Notes is not working.When I press Post Notes or View Notes this error occured.Every user same thing

"No User specified. If you followed a valid link, please notify the administrator"

Any idea for this ?

**Bump**

Logician 06-20-2007 04:10 PM

Quote:

Originally Posted by Bulent Tekcan (Post 1266304)
**Bump**

I guess this happens because you use the unsupported "make it work in ALL vb pages" version. As stated in that hack of hack, it is not tested well and it can cause such problems. This is because the original of this hack is not designed to run in all vb pages but only in forum home. So if you have the problem, please revert to the original supported version of the hack.

Soliloquy 06-22-2007 04:49 AM

I'd like to display a message each Thursday to remind users it's chat night, and another each Thursday between 9 and 11 p.m. to remind users to go to the chat room. The first post says this plugin has that functionality, but there are no examples given with the rest of the usage instructions.


All times are GMT. The time now is 04:25 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.02298 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
  • (7)bbcode_code_printable
  • (3)bbcode_php_printable
  • (15)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