jGrowl sticky on Forum

Discussion forum for MOD Writers regarding MOD Development.
Locked
ScottieDog
Registered User
Posts: 268
Joined: Fri Nov 20, 2009 8:26 pm

jGrowl sticky on Forum

Post by ScottieDog »

Hey all,

I want to install a "jGrowl sticky" for when the index of my Forum loads. Anyone know how I do this with phpBB ? (It is just a pop up tab, which removes itself a few seconds later, just with a couple of lines of intro text).

I installed it fine on my standard website, there are 4 jGrowl files which go into the root folder of the page (1 x css, and 3 x .js) and then there´s a script which is input into the header of the page. I put the script below, so you can see it, but where would I paste it in php t make it work ? And how would I link the files (would I just have to host them on my server, and point them in the script to there ?).

And there you go...

How do I do this with my PHP forum ? :?

Cheers.

Scott

ScottieDog
Registered User
Posts: 268
Joined: Fri Nov 20, 2009 8:26 pm

Re: jGrowl sticky on Forum

Post by ScottieDog »

Sorry dudes. Sort of answered my own question I suppose. Done it, and it is working great ! Just put the script into the overall header, in the templates and pointed the .js links to my server position of the files...

WICKED.

Cheers anyway.

ScottieDog
Registered User
Posts: 268
Joined: Fri Nov 20, 2009 8:26 pm

Re: jGrowl sticky on Forum

Post by ScottieDog »

HAAAA. It is working, but because I put the script into "overall header" it is coming up on every single Forum page. I only want it on the INDEX....

Where do I put the script if I only want to see the sticky tab on the forum index only ?

Thanks.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51930
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: jGrowl sticky on Forum

Post by Brf »

You could probably put it at the top of index_body.html

User avatar
m157y
Registered User
Posts: 482
Joined: Mon Apr 30, 2007 9:39 am
Location: Russia, Moscow, Khimki
Contact:

Re: jGrowl sticky on Forum

Post by m157y »

as i think this plugin must be at <head> section of html.
so you can use this:

Code: Select all

<!-- IF SCRIPT_NAME == 'index' -->
YOUR SCRIPT ROUTINE HERE
<!-- ENDIF -->
m157y aka Misty
NO SUPPORT VIA PM
KarmaMOD for phpBB 3.0.x | bbAJAX
Follow me on twitter

ScottieDog
Registered User
Posts: 268
Joined: Fri Nov 20, 2009 8:26 pm

Re: jGrowl sticky on Forum

Post by ScottieDog »

THANKS brf and M157.

Went with the script from m157 and it worked a treat.. Cheers. :D

ScottieDog
Registered User
Posts: 268
Joined: Fri Nov 20, 2009 8:26 pm

Re: jGrowl sticky on Forum

Post by ScottieDog »

I am doing exactly the same thing with a WordPress Blog, and that is obviously having the same problem, repeating the sticky on every page...

So, I added your code M157, and thats not working with the WordPress. Would you know why ? (may not be your departmenet, but I know you dudes are so switched on, you will no doubt know why) :D

Anything you can advise (sorry, for not being phprelated, but it sort of is.... ;) )

User avatar
m157y
Registered User
Posts: 482
Joined: Mon Apr 30, 2007 9:39 am
Location: Russia, Moscow, Khimki
Contact:

Re: jGrowl sticky on Forum

Post by m157y »

Of course i doesn't work at WordPress, because SCRIPT_NAME is a variable of phpBB, also, as i remember at WordPress used little different way for if-else statements at templates.
PS
My nickname is m157y, not m157y ;)

Edit:
Some google and i'm right :)
At wordpress it must be something like this:

Code: Select all

<?php /* If this is the frontpage */ if ( is_home() ) { ?>
YOUR SCRIPT ROUTINE HERE
<?php } ?>
Try it to wp's theme editor.
m157y aka Misty
NO SUPPORT VIA PM
KarmaMOD for phpBB 3.0.x | bbAJAX
Follow me on twitter

ScottieDog
Registered User
Posts: 268
Joined: Fri Nov 20, 2009 8:26 pm

Re: jGrowl sticky on Forum

Post by ScottieDog »

Worked perfectly.

Thanks m157y :lol:

ScottieDog
Registered User
Posts: 268
Joined: Fri Nov 20, 2009 8:26 pm

Re: jGrowl sticky on Forum

Post by ScottieDog »

Of course, silly me... now I have the problem that every time a user goes back to index after reading or making a post, the sticky comes up again, then they go off to another post and when they go back to the board index, the sticky comes up again.... now that is rather annoying.

SOO, is there a way of dropping a cookie or something, and making the sticky appear on their first visit only in the session.... ? Dont wanna be repetitive with it.....

Never considered that did I...... :oops:

Cheers.

ScottieDog
Registered User
Posts: 268
Joined: Fri Nov 20, 2009 8:26 pm

Re: jGrowl sticky on Forum

Post by ScottieDog »

WOW. This is the first time I have had to wait for a reply :o Is this a difficult one, orrr ?

User avatar
m157y
Registered User
Posts: 482
Joined: Mon Apr 30, 2007 9:39 am
Location: Russia, Moscow, Khimki
Contact:

Re: jGrowl sticky on Forum

Post by m157y »

Want with cookies? Khm, use this:
include/function.php
FIND

Code: Select all

	define('HEADER_INC', true);
AFTER ADD

Code: Select all

	$s_jgrowl = false;
	if ($user->page['page_name'] == 'index.' . $phpEx)
	{
		$jgrowl = request_var($config['cookie_name'] . '_jgrowl', 0, false, true);
		$s_jgrowl = (!$jgrowl) ? true : false;
		unset($jgrowl);
	}
FIND

Code: Select all

		'S_USER_LOGGED_IN'		=> ($user->data['user_id'] != ANONYMOUS) ? true : false,
BEFORE ADD

Code: Select all

		'S_JGROWL'						=> $s_growl,
and at template(overall_header.html)
instead our checker

Code: Select all

<!-- IF SCRIPT_NAME == 'index' -->
use this checker

Code: Select all

<!-- IF S_JGROWL -->
How it works, on index page we checks cookie exists, if not we shows a notify. Also on index page we sets a cookie with expire time on session length.
Must works as you wish.
And sorry, i can't say how do it at WordPress.
m157y aka Misty
NO SUPPORT VIA PM
KarmaMOD for phpBB 3.0.x | bbAJAX
Follow me on twitter

ScottieDog
Registered User
Posts: 268
Joined: Fri Nov 20, 2009 8:26 pm

Re: jGrowl sticky on Forum

Post by ScottieDog »

Excellent. thank-you m157y

:D

Locked

Return to “[3.0.x] MOD Writers Discussion”