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)

TheSaint-AeD 10-17-2002 07:58 AM

Awesome Hack!

Would it be possible to add some comfort to it? ;) New Option in ACP (I don't care about the 1 query) and some usefull buttons to easier configure the conditionals, similiar to bbcode in posts, like a drop down menu where you can choose the usergroup it is shown to, Integration of BBCode-Buttons etc...

Guess this is a lot work, isn't it? ;) I would very appreciate if you could take the time.

Logician 10-17-2002 12:10 PM

Quote:

Originally posted by TheSaint-AeD
Guess this is a lot work, isn't it? ;) I would very appreciate if you could take the time.
yes that's a lot of work and would take time which I dont have at the moment.. ;)

Actually I use "conditonals" in many of my hacks and I know that although they are powerful, they are not "newbie-friendly". Therefore I always thought a kind of visual mask for conditionals which would help ordinary users to form them more easily. But there is no easy way to code such an integration. For example you told about choosing "usergroups" from a pull down option which is a good idea but a conditional does not necessarily include a usergroup. It can involve ALL vb user related variables like userid, register date, style id etc, and also ALL the other VB variables like forumid, threadid, post id (that's for my other hacks using conditionals). Besides they can coexist together: For example someone might want to create a conditional which will apply if user group is 6 AND user is viewing thread 17 AND today is his birthday. :) Well I still couldnt find a way to create a visual mask that will help you forming this conditional. I have to trust the fact that most of the users using hacks with conditionals are "power users" who would need little help to form them.. ;)

kreatiV 10-27-2002 08:25 AM

Most fantastic this hack! Very easy to install and works as promised in 2.2.8 with the changed step 4.

kreatiV 10-27-2002 09:12 AM

Is there a way to have a general Personal Conditional?

Something like,

Welcome, [NICKNAME] to the board. Please make sure that you read the Info & News Forum.

So instead of [NICKNAME] it shows the users name?

Logician 10-27-2002 09:38 AM

Welcome, $bbuserinfo[username] to the board. Please make sure that you read the Info & News Forum.

cono 10-31-2002 12:24 AM

is there a way to make it have a fader? like its a news fader.

i saw a hack on a board once, i dont know the name of the hack, but i was wondering if this could do the same thing?

it fades from one paragraph to the other, like a javascript fader? could this hack do that also with somw extra modifications?

btw, awesome hack! i installed it with no problems.

thanks.

Logician 10-31-2002 09:08 AM

Quote:

Originally posted by cono
is there a way to make it have a fader? like its a news fader.

i saw a hack on a board once, i dont know the name of the hack, but i was wondering if this could do the same thing?

it fades from one paragraph to the other, like a javascript fader? could this hack do that also with somw extra modifications?

If a javascript is doing the fade, it may be applied to this hack. I dont know how that script works but say if it has a main function and a tag like
[fade] your text goes here [/fade]

all you have to do is put the tag [fade] in your announcement box and the main function inside your forumhome template..

Of course if the script works differently, different solutions may apply..

RayMatrix 11-01-2002 06:29 PM

. . .that warns a user when the PN-Counter ($allpm[messages]) is higher than 'x' PN's.

I tried this code:

[[($bbuserinfo[allpm]>=40)]]
Hallo $bbuserinfo[username],

In Deinen PN Postf?chern liegen zur Zeit $allpm[messages] gesammelte Nachrichten.

Noch $rest und Du kannst keine mehr empfangen !!

Bitte ?berpr?fe Dein Postfach und l?sche nicht mehr ben?tigte Nachrichten.

Danke und Gru?

RayMatrix[[/($bbuserinfo[allpm]>=40)]]


And also this one:

[[($allpm[messages]>=40)]]
Hallo $bbuserinfo[username],

In Deinen PN Postf?chern liegen zur Zeit $allpm[messages] gesammelte Nachrichten.

Noch $rest und Du kannst keine mehr empfangen !!

Bitte ?berpr?fe Dein Postfach und l?sche nicht mehr ben?tigte Nachrichten.

Danke und Gru?

RayMatrix[[/($allpm[messages]>=40)]]


Both wont work for me.

My Question is:
Is $bbuserinfo only looking for fields wich are in DB Folder 'user' ?
If no, what do i have to change to read from all the other folders in the DB ?

Thanks for your help

Regards

Logician 11-02-2002 10:34 AM

Quote:

Originally posted by RayMatrix
. . .that warns a user when the PN-Counter ($allpm[messages]) is higher than 'x' PN's.

Actually this works:

[[($allpm[messages]>=40)]]
Hallo $bbuserinfo[username],

In Deinen PN Postf?chern liegen zur Zeit $allpm[messages] gesammelte Nachrichten.

Noch $rest und Du kannst keine mehr empfangen !!

Bitte ?berpr?fe Dein Postfach und l?sche nicht mehr ben?tigte Nachrichten.

Danke und Gru?

RayMatrix[[/($allpm[messages]>=40)]]


But you need to apply the hack to your index.php (not global.php) so that it will work. Because variable $allpm[messages] is assigned a value in index.php and global.php runs before index.php runs. Therefore it is blank if you apply the code in global.php.

The answer to your question is: This hack is competible with ALL vb variables available provided that they are assigned a value before dynamic announcement code is run..

RayMatrix 11-02-2002 01:42 PM

. . .but your explanation is to hard for me to understand.

Quote:

Original posted by Logician
But you need to apply the hack to your index.php (not global.php) so that it will work
Wich hack do you meen here ?

If you meen your code:
PHP Code:

// Logician Dynamic Forum Announcements Hack
$dynamic_fha=strchr($optionstemp['template'],'$dynamic_fha = "');
eval(
$dynamic_fha);
$dfh_announcement=dynamic_a($dynamic_fha);
// Logician Dynamic Forum Announcements Hack 

then its ok, i added it to index.php, cause your installinstruction tells to do at step 4.

And another Question:

Is there any place where i can read about the Variables so i can understand where '$bbuserinfo' comes from ? And is it right that your Code only get called in index.php when i insert the code as step 4 tells to do ?

Thanks for all

Regards

Logician 11-02-2002 02:04 PM

Quote:

Originally posted by RayMatrix
. . .but your explanation is to hard for me to understand.

ok let me clarify:

find the hack code in index.php (the one you referred above) and cut (delete) it.

Now go at the end of index.php, find:

PHP Code:

eval("dooutput(\"".gettemplate('forumhome')."\");"); 

Before that paste (insert) the hack code, then you'll be fine..

Quote:

Is there any place where i can read about the Variables so i can understand where '$bbuserinfo' comes from ?
$bbuserinfo variable saves the info of the page visitor according to the "user" and "userfield" tables. Field names in these tables are also references in this variable. So for example the "usergroupid" field in user table is $bbuserinfo[usergroupid]. Check the fields in these 2 tables and you'll see what this variable keeps.

Quote:

And is it right that your Code only get called in index.php when i insert the code as step 4 tells to do ?
What I meant was that: Check where the hack code resides and where your variable $allpm[messages] gets a value. The hack code is parsed BEFORE $allpm[messages] is assigned a value so it couldnt work in your announcement.

If you heed to my advice and change the code's location, the hack would parse the $allpm[messages] variable because it would already have a value BEFORE hack runs..

See?

RayMatrix 11-02-2002 03:38 PM

. . .and i think the creator also ;)

THX for your help, great Hack. . .i love it more from minute to minute !

Keep on your good work !!

Regards

LOD-squa 11-04-2002 06:26 PM

I have a question can you do this outside the announcement?

Logician 11-04-2002 06:40 PM

Quote:

Originally posted by gohanssj2
I have a question can you do this outside the announcement?
Do what? If you mean "using conditionals", I have some other hacks using them:
For non-vb web pages check webtemplates hack
For vb templates check dynamic templates hack

LOD-squa 11-04-2002 07:20 PM

Quote:

Originally posted by Logician

Do what? If you mean "using conditionals", I have some other hacks using them:
For non-vb web pages check webtemplates hack
For vb templates check dynamic templates hack

Could you link me to dynamic templates?

Logician 11-04-2002 07:36 PM

Quote:

Originally posted by gohanssj2
Could you link me to dynamic templates?
Advanced Templates: Dynamic Templates Changing according to different conditions

LOD-squa 11-04-2002 07:41 PM

Okay Thanks for your help man.

Bison 11-05-2002 02:21 AM

This is one friggin *cool* hack ... this should be implemented into vB 3.0 in a major way!

[SIZE=3 ] SIX STARS !!! [/SIZE] :banana:

Cyberhouse 11-07-2002 06:13 AM

Quote:

Originally posted by Rolodex
This is one friggin *cool* hack
Agree :D

Obi-Wan 11-20-2002 04:23 PM

Very very kewl hack.

Me tries to install :)

Banana 11-20-2002 08:08 PM

Just installed it and everything works fine.....except I can't embed bbcode (e.g. , ) in the announcement. I have no conditionals....so just an announcement everyone can see. Ideas?

Logician 11-20-2002 10:53 PM

Quote:

Originally posted by Banana
Just installed it and everything works fine.....except I can't embed bbcode (e.g. , ) in the announcement. I have no conditionals....so just an announcement everyone can see. Ideas?
Did you read here?

Banana 11-21-2002 08:01 AM

Yes, but which post? Maybe best if you quote a little bit of it....i'll manage then! ta

Logician 11-21-2002 08:10 AM

Quote:

Originally posted by Banana
Yes, but which post? Maybe best if you quote a little bit of it....i'll manage then! ta
My link was supposed to take directly to the post itself (you need to wait the page loaded completely). It's postid 78 in this thread with a big red title:
IMPORTANT NOTICE FOR V.2.2.8 (OR LATER) USERS:

Banana 11-21-2002 01:47 PM

Yes, the contents of that post are in the installation instructions and applied correctly.

Banana 11-22-2002 09:59 AM

Incidentally, I don't get the symptoms as described in that post. The CONDITIONALS appear to work fine. It's the vbCode that don't (e.g. "[b]").

Other than that - fantastic hack!

Logician 11-22-2002 01:39 PM

Quote:

Originally posted by Banana
[B]Incidentally, I don't get the symptoms as described in that post. The CONDITIONALS appear to work fine. It's the vbCode that don't (e.g. "").

1- What exactly happens when you use them? (Any screenshots?)
2- Can you use $bbuserinfo[username]?
3- Can you use smilies?
4- What's your vb version?
5- Can you use other vb code like quote or php or font
6- Do URL converted well?
7- Is there any chance that you modified default vb code for bold or italic in Admin CP/BB Code section?

Banana 11-22-2002 01:47 PM

Quote:

Originally posted by Logician

1- What exactly happens when you use them? (Any screenshots?)
2- Can you use $bbuserinfo[username]?
3- Can you use smilies?
4- What's your vb version?
5- Can you use other vb code like quote or php or font
6- Do URL converted well?
7- Is there any chance that you modified default vb code for bold or italic in Admin CP/BB Code section?

1. Text reads: "A test announcement [ b]bold [ b] Here's a smile : )" in announcement admin box and on the actual announcement shown to user(s). (n.b. I've added spaces in THIS post between bb codes - otherwise they work here :( )
2. No
3. No.
4. 2.2.8 (Yes I have installed the patch for 2.2.8 as described above)
5. No
6. Not sure what you mean
7. No - they work fine in actual postings.

Logician 11-22-2002 10:04 PM

Quote:

Originally posted by Banana
[B]Incidentally, I don't get the symptoms as described in that post. The CONDITIONALS appear to work fine. It's the vbCode that don't (e.g. "").

weird.. I installed a test 228 board from the ground and applied the hack to test the bug you mentioned, but hack works fine in the 228 board as you can see in the screenshot. :rolleyes:

Only thing I can think of is the existance of another hack in your board which clashes with this one in the function.php. To test it, try this:

In hack code find,
PHP Code:

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

And replace as:

PHP Code:

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

and find:
PHP Code:

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

Replace as
PHP Code:

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


Banana 11-22-2002 11:42 PM

No dice. This is how the bottom of functions.php looks post the above eidt being applied.......
Code:

// Logician Dynamic Forum Announcements Hack
function dynamic_a($logician_dfa_incoming1)
{
extract ($GLOBALS);

while (preg_match("/\[\[(.*)\]\](.*)\[\[(\/\\1)\]\]/siU",$logician_dfa_incoming1,$matches14))
{
        /*
        echo "<br> conditional parse- 1=".$matches14[1];
        echo '$matches14[0]'.$matches14[0].'<br><br>';// => Whole text
        echo '$matches14[1]'.$matches14[1].'<br><br>';// => conditional itself
        echo '$matches14[2]'.$matches14[2].'<br><br>';// => Text between conditional
        echo '$matches14[3]'.$matches14[3].'<br><br>';// => conditional close tag (with closing /)
        */
@eval ('if ('.stripslashes($matches14[1]).') { $eval_deger= "1"; } else { $eval_deger= "0"; }');
        if ($eval_deger==1)        //if conditional applied
                {
                //$logician_dfa_incoming1=preg_replace("/\[\[(.*)\]\](.*)\[\[(\/\\1)\]\]/siU", "\\2", $logician_dfa_incoming1);
                //echo "conditional $matches14[1] applied!<br>" ;
                $matches14[2]=bbcodeparse(trim($matches14[2]),1,1,1,1);
                eval("\$dfh_announcement1 = \"".gettemplate("dfh_announcement")."\";");
                return $dfh_announcement1;
                }
        else //conditional not applied so let's delete it so that it wont be matched in preg_match again..
                {$logician_dfa_incoming1=str_replace($matches14[0], '', $logician_dfa_incoming1);}

}

//echo "no conditional found or applies<br>";
                $matches14[2]=trim($logician_dfa_incoming1);
                if (trim($matches14[2])) {$matches14[2]=bbcodeparse($matches14[2],1,1,1,1);eval("\$dfh_announcement1 = \"".gettemplate("dfh_announcement")."\";");}
                return $dfh_announcement1;
}
// Logician Dynamic Forum Announcements Hack
?>

There's no other hacks in the file.

I changed announcement text and saved it too.

Banana 11-23-2002 08:14 AM

This is unrelated and a small suggestion. Rather than have the admin function tucked away at the end of a very long page. Why not have it linked directly off its own control panel navigation link in the left hand column?

Logician 11-23-2002 09:40 AM

Quote:

Originally posted by Banana
This is unrelated and a small suggestion. Rather than have the admin function tucked away at the end of a very long page. Why not have it linked directly off its own control panel navigation link in the left hand column?
it would require a little bit more hacking and an additinal 1 query in your main page so this is why I integrated into vb settings section (detailed info is somewhere in the thread). But if you find the announcement edit column small, you can enlarge it. I gave the hack for it in the thread.

BTW. can u still not see bbcode after you applied the change I gave you above?

Banana 11-23-2002 09:43 AM

Quote:

Originally posted by Logician
BTW. can u still not see bbcode after you applied the change I gave you above?
Correct - Still doesn't work - that's what post #110 says.

Thanks for the rest of your post above BTW.

Banana 11-26-2002 02:49 PM

Logician, if I change "bbcodeparse" to "bbcodeparse2" in the code section I posted about 5 messages up I get the bold, and quote and smilies working BUT i still get "$bbuserinfo[username]" (without the surrounding quotes) appearing in the announcements.

KarateKid 11-30-2002 04:12 PM

Hi,

does it work with 2.2.9 ?

Regards.

Logician 11-30-2002 04:33 PM

Quote:

Originally posted by KarateKid
does it work with 2.2.9 ?

I didnt test myself but I believe it should work provided that you apply the 2.2.8 modification in the installation. I appreciate if someone who tested confirms this.

KarateKid 11-30-2002 05:48 PM

okay, thanks.

I'll try it :)

freeshares1 12-22-2002 07:05 PM

Thanks, This is fanatasic......

Shpookdefied 01-13-2003 06:14 AM

Well, I just tried installing on 2.2.9, and have absolutley nothing to show for it. The options arent coming up in AdminCP. I'm a bit confused, and pretty new to this, so any help would be much appreciated. But still, it's a very nice hack.

Logician 01-13-2003 08:08 AM

Quote:

Originally posted by Shpookdefied
Well, I just tried installing on 2.2.9, and have absolutley nothing to show for it. The options arent coming up in AdminCP. I'm a bit confused, and pretty new to this, so any help would be much appreciated. But still, it's a very nice hack.
sounds like a template problem. Make sure you made the template modifications/additions correctly (check template name, it's caps etc. too) and if you have more than 1 template sets, apply the modifications in all sets..

Also make sure you clicked "APPLY" in vb settings section after you installed the hack


All times are GMT. The time now is 09:58 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.01597 seconds
  • Memory Usage 1,861KB
  • 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
  • (1)bbcode_code_printable
  • (6)bbcode_php_printable
  • (20)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