Not Solved DNT Announcements (index page only)
#1
Not Solved Lightbulb 
hi there,

i've installed this plugin and run good, but the announcement displayed all pages on the forum. How can i do, if is possible, to display the message only on the index page ?

thank you for help me Smile
Reply
#2
Not Solved
open the plugin file in editor like notepad++ or through file manager at web host panel

around line 13 find code like below
$plugins->add_hook('global_intermediate', 'dnt_announcements_global');

you can change it like below, save the file & check if it works only on the index
$plugins->add_hook('index_end', 'dnt_announcements_global');
Reply
#3
Not Solved
thanks for your reply.

need i to access the server for open the plugin file ou can i do it by the admin panel ? be cause i have not access to the server.

even i want another page (like portal, getnew ant getdaily pages), is it possible ? i'm sorry but i don't know php langage (i recently replace the administrator who not time for continue maintenance on my forum).

thank you
Reply
#4
Not Solved
access to files is required (ftp or web host panel)

if you want to show the plugin output on specific pages then you can try using
template conditionals plugin. however installing plugins requires files access.
Reply
#5
Not Solved
i understand. i must demand acces of the server of the forum for continue.

thank you for informations.

hello

i spoke with the ancien administrator. then i can display the announcement for all pages i want. for make this, he put the code below on the plug-in file
global $announcements;
eval("\$announcements = \"".$templates->get("announcements",1,0)."\";");

and created an announcements template for the message and associate html :
<!-- <div class="dnt_announcements_registered">Hi {$mybb->user['username']} this is an announcement for all registered users on the forum !!!</div> -->

afterall, i put the {$announcements} tag after the {$header} tag of all the pages i want.

do you means this method is safe ?
Reply
#6
Not Solved
Nope i think that methos is unnecessary due you can only go to your header templates and remove this var.

$dnt_announcements

then add it into index template, but best method is as .m. says to change hook to load only into index Smile

See yah !!!
The only infinite thing is the universe and human stupidity, but the universe is not for sure

Plugins 1.6.x

Plugins 1.8.x

Reply
#7
Not Solved
(2017-07-01, 10:51 AM).m. Wrote: open the plugin file in editor like notepad++ or through file manager at web host panel

around line 13 find code like below
$plugins->add_hook('global_intermediate', 'dnt_announcements_global');

you can change it like below, save the file & check if it works only on the index
$plugins->add_hook('index_end', 'dnt_announcements_global');

this method don't work. we test another combination with 'index_start' too and with the pages 'build_forumbits_forum' and 'memberlist_intermediate'. for all time, the annoucement don't appears. is it a problem form the initialization of the variable ?

thanks
Reply
#8
Not Solved
(2017-07-05, 11:15 PM)Caïthness Wrote:
(2017-07-01, 10:51 AM).m. Wrote: open the plugin file in editor like notepad++ or through file manager at web host panel

around line 13 find code like below
$plugins->add_hook('global_intermediate', 'dnt_announcements_global');

you can change it like below, save the file & check if it works only on the index
$plugins->add_hook('index_end', 'dnt_announcements_global');

this method don't work. we test another combination with 'index_start' too and with the pages 'build_forumbits_forum' and 'memberlist_intermediate'. for all time, the annoucement don't appears. is it a problem form the initialization of the variable ?

thanks

That is because you have to use the right var on right template:
Once you have changed that hook to index_end you have to add into your index template:

{$dnt_announcements}

Whenever you wish to display announcements and done !!!

In other ways you have to do

(2017-07-02, 02:52 PM)Dark Neo Wrote: Nope i think that methos is unnecessary due you can only go to your header templates and remove this var.

$dnt_announcements

then add it into index template, but best method is as .m. says to change hook to load only into index Smile

See yah !!!

And have to work fine...

See yah !!!
The only infinite thing is the universe and human stupidity, but the universe is not for sure

Plugins 1.6.x

Plugins 1.8.x

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)