[Released] News Ticker

MODs and Styles for phpBB3.

To post your MOD or style, go to the STG MOD Manager
Forum rules
Go to http://startrekguide.com/mods to submit your MOD or style

Re: [Released] News Ticker

Postby jdrechsler » 08 Sep 2010, 08:08

cossielee wrote:
Spoiler:
jdrechsler wrote:ok well I created a way to do it when not in the ACP

Open styles\prosilver\templates\overall_header.html
Find at the top of the file
Code: Select all
<p class="{S_CONTENT_FLOW_END}<!-- IF S_USER_LOGGED_IN --> rightside


Add after
Code: Select all
<div class="inner"><span class="corners-top"><span></span></span>
   <form action="<?php echo $_SERVER['php_SELF'];?>" method="post">
   <table cellspacing="5px" style="line-height: 2.2em; font-size:1.1em;">
      <tr>
         <td>{L_FORUM_COLOR}</td><td><input size ="5" maxlength="6" name="FORUM_COLOR" value="{FORUM_COLOR}"/></td><td>{L_NEWS_FORUM}</td><td><input size ="20" name="NEWS_FORUM" value="{NEWS_FORUM}"/></td>
         <td>{L_WORLD_COLOR}</td><td><input size ="5" maxlength="6" name="WORLD_COLOR" value="{WORLD_COLOR}"/></td><td>{L_NEWS_WORLD}</td><td><input size ="20" name="NEWS_WORLD" value="{NEWS_WORLD}"/></td>
         <td>{L_SPORT_COLOR}</td><td><input size ="5" maxlength="6" name="SPORT_COLOR" value="{SPORT_COLOR}"/></td><td>{L_NEWS_SPORT}</td><td><input size ="20" name=NEWS_SPORT" value="{NEWS_SPORT}"/></td>
         <td><input type="submit" value="Update" name="newsticker" class="submit"/></td>
      </tr>
   </table>
   </form>
<span class="corners-bottom"><span></span></span></div>


Open \index.php
Find:
Code: Select all
display_forums('', $config['load_moderators']);


Add after:
Code: Select all
//news mod
if(isset($_POST['newsticker'])){
$forum_color = request_var('FORUM_COLOR','');
$news_forum = request_var('NEWS_FORUM','');
$world_color = request_var('WORLD_COLOR','');
$news_world = request_var('NEWS_WORLD','');
$sport_color = request_var('SPORTS_COLOR','');
$news_sport = request_var('NEWS_SPORT','');

set_config('forum_color', $forum_color);
set_config('news_forum', $news_forum);
set_config('world_color', $world_color);
set_config('news_world',$news_world);
set_config('sport_color', $sport_color);
set_config('news_sport', $news_sport);

}
//end news mod


I am sure there is a better way to do the set_config(), but this is how I got it working. Now a fair amount of this you can adjust depending on where you want it and how you want it to look


Hey jdrechsler, i couldnt find this
Code: Select all
<p class="{S_CONTENT_FLOW_END}<!-- IF S_USER_LOGGED_IN --> rightside
in overall_header.html but i did find it in index_body.html, is that correct??

I tried putting it in the index_body.html but it looked a bit of a mess to be honest. I originally thought your code was for MoDs to be able to change the News ticker but according to my test forum anyone could see it.

Guess it was worth a try mate :good: Would be good to see this MoD updated as i think its great, i really need to have so my MoDs can change it without giving them admin powers.


Yes anyone can see it. You have to wrap it in something that only some can see. if you want only mods to see it you would use <!-- IF MCP -->put here<!-- ENDIF -->, I think thats the one. OR ACP if just admins.
I put mine in the overall_header.html, what style were you using?
What I put up was just a simple table to put them in. If yours was a mess I am willing to bet that it was due to the style that you are using, as mine is a 100% width, its not limited.
jdrechsler
Ensign
Ensign
 
Posts: 61
Joined: 27 Jun 2009, 15:42
Gender: Male
phpBB Knowledge: 4


Re: [Released] News Ticker

Postby cossielee » 08 Sep 2010, 18:49

jdrechsler wrote:
cossielee wrote:
Spoiler:
jdrechsler wrote:ok well I created a way to do it when not in the ACP

Open styles\prosilver\templates\overall_header.html
Find at the top of the file
Code: Select all
<p class="{S_CONTENT_FLOW_END}<!-- IF S_USER_LOGGED_IN --> rightside


Add after
Code: Select all
<div class="inner"><span class="corners-top"><span></span></span>
   <form action="<?php echo $_SERVER['php_SELF'];?>" method="post">
   <table cellspacing="5px" style="line-height: 2.2em; font-size:1.1em;">
      <tr>
         <td>{L_FORUM_COLOR}</td><td><input size ="5" maxlength="6" name="FORUM_COLOR" value="{FORUM_COLOR}"/></td><td>{L_NEWS_FORUM}</td><td><input size ="20" name="NEWS_FORUM" value="{NEWS_FORUM}"/></td>
         <td>{L_WORLD_COLOR}</td><td><input size ="5" maxlength="6" name="WORLD_COLOR" value="{WORLD_COLOR}"/></td><td>{L_NEWS_WORLD}</td><td><input size ="20" name="NEWS_WORLD" value="{NEWS_WORLD}"/></td>
         <td>{L_SPORT_COLOR}</td><td><input size ="5" maxlength="6" name="SPORT_COLOR" value="{SPORT_COLOR}"/></td><td>{L_NEWS_SPORT}</td><td><input size ="20" name=NEWS_SPORT" value="{NEWS_SPORT}"/></td>
         <td><input type="submit" value="Update" name="newsticker" class="submit"/></td>
      </tr>
   </table>
   </form>
<span class="corners-bottom"><span></span></span></div>


Open \index.php
Find:
Code: Select all
display_forums('', $config['load_moderators']);


Add after:
Code: Select all
//news mod
if(isset($_POST['newsticker'])){
$forum_color = request_var('FORUM_COLOR','');
$news_forum = request_var('NEWS_FORUM','');
$world_color = request_var('WORLD_COLOR','');
$news_world = request_var('NEWS_WORLD','');
$sport_color = request_var('SPORTS_COLOR','');
$news_sport = request_var('NEWS_SPORT','');

set_config('forum_color', $forum_color);
set_config('news_forum', $news_forum);
set_config('world_color', $world_color);
set_config('news_world',$news_world);
set_config('sport_color', $sport_color);
set_config('news_sport', $news_sport);

}
//end news mod


I am sure there is a better way to do the set_config(), but this is how I got it working. Now a fair amount of this you can adjust depending on where you want it and how you want it to look


Hey jdrechsler, i couldnt find this
Code: Select all
<p class="{S_CONTENT_FLOW_END}<!-- IF S_USER_LOGGED_IN --> rightside
in overall_header.html but i did find it in index_body.html, is that correct??

I tried putting it in the index_body.html but it looked a bit of a mess to be honest. I originally thought your code was for MoDs to be able to change the News ticker but according to my test forum anyone could see it.

Guess it was worth a try mate :good: Would be good to see this MoD updated as i think its great, i really need to have so my MoDs can change it without giving them admin powers.


Yes anyone can see it. You have to wrap it in something that only some can see. if you want only mods to see it you would use <!-- IF MCP -->put here<!-- ENDIF -->, I think thats the one. OR ACP if just admins.
I put mine in the overall_header.html, what style were you using?
What I put up was just a simple table to put them in. If yours was a mess I am willing to bet that it was due to the style that you are using, as mine is a 100% width, its not limited.


Hi Jd, i use SE-pro, ended up not bothering with the above, i agree that it was probably my style tht messed it, i am however thinking of adding more text boxes. I also added code to make this visable only to those who have signed in :good:

Only problem i have is when i insert the txt in the ACP as a link the colour feature doesnt work and it comes out the default forum font colour (see pic below), it might have something to do with the code i put in for increasing the font size but other than that its a great MOD :good:

Image
cossielee    
Crewman
Crewman
 
Posts: 5
Joined: 29 Jul 2010, 17:15
Gender: Male
phpBB Knowledge: 4

Re: [Released] News Ticker

Postby Zohall » 10 Sep 2010, 09:26

can i use this mod for phpBB 3.0.7?
User avatar
Zohall    
Lieutenant
Lieutenant
 
Posts: 202
Joined: 16 Aug 2010, 05:39
Location: Hecatompylos
Favorite Team: Real Madrid
Gender: Male
phpBB Knowledge: 6

Re: [Released] News Ticker

Postby cossielee » 12 Sep 2010, 16:50

Zohall wrote:can i use this mod for phpBB 3.0.7?


You sure can sir :good:

Iv managed to create an additional text box, so now i have 4, it was pretty simple and you could actually add a few more though space might be tight, speaking of which, i also put in space between each text, looks pretty darn good :good:
cossielee    
Crewman
Crewman
 
Posts: 5
Joined: 29 Jul 2010, 17:15
Gender: Male
phpBB Knowledge: 4

Previous

Return to phpBB3 Customizations

Who is online

Users browsing this forum: Google Adsense [Bot] and 19 guests