[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 ickleo » 17 May 2009, 16:05

Hi i like this ticker :)

I have a question for you :D

I have a php file which collects a player list from a game server and translates it to html. Is it possible to get this info in the ticker???

Any help is appreciated :D

Thanks :good:
ickleo    
Crewman
Crewman
 
Posts: 5
Joined: 13 May 2009, 22:22
Gender: Male
phpBB Knowledge: 1




phpBB Academy at StarTrekGuide
Support STG
Using PayPal Donate

Re: [Released] News Ticker

Postby websponge » 18 May 2009, 02:49

cant see that being a problem , can you paste whats in your file?
User avatar
websponge    
Lt. Jr Grade
Lt. Jr Grade
 
Posts: 177
Joined: 22 Mar 2007, 10:11
Favorite Team: Arsenal
Gender: Male
phpBB Knowledge: 4

Re: [Released] News Ticker

Postby ickleo » 18 May 2009, 11:41

Hi basically this is the players.php file i have and it just opens into a blank webpage at the moment. http://www.ickleo.co.uk/players

Would just like to see if these results could be implemented into the ticker :D



Code: Select all
<?
   $ip=""; //IP address of server
   $port=; //Port for remote access
   $user= ""; // SuperAdmin Login
   $pass= ""; // SuperAdmin Password

    require("includes/GbxRemote.inc.php");
    require("classes/tmfcolorparser.inc.php");

    $client = new IXR_Client_Gbx;
    $colors= new tmfcolorparser;

    if (!$client->InitWithIp($ip,$port)) {
       echo'An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage();
    }
    if (!$client->query("Authenticate", $user, $pass)) {
       
       print "login failed !<br/>";
    }
    if($client->query('GetStatus')) {
       $Status = $client->getResponse();
       }
    if($client->query('GetPlayerList',500,0)) {
       $Players = $client->getResponse();
       }
    if($client->query('GetServerOptions')) {
       $ServerOptions = $client->getResponse();
       $servername=$ServerOptions['Name'];
       $MaxPLayers=$ServerOptions['CurrentMaxPlayers'];
       }   
    $pl=0;   
    foreach ($Players as $player) {
       $pl++;
       }
    if($client->query('GetCurrentChallengeInfo')) {
       $CurrentChallengeInfo = $client->getResponse();
       $trackname=$CurrentChallengeInfo['Name'];   
       }
       
    //Taking game info
    if($client->query('GetCurrentGameInfo')) {
       $GetCurrentGameInfo=$client->getResponse();
       $GameMode=$GetCurrentGameInfo["GameMode"];
    }

    //Formatitng GAme Mod
    switch($GameMode){
       case 0:
          $GameMode="Rounds";
          Break;
       case 1:
          $GameMode="Time Attack";
          Break;
       case 2:
          $GameMode="Team";
          Break;
       case 3:
          $GameMode="Laps";
          Break;
       case 4:
          $GameMode="Stunts";
          Break;
       case 5:
          $GameMode="Cup";
          Break;
    } 



foreach ($Players as $player) {
$PlayerLogin = $colors->toHTML($player['NickName']);
echo "$PlayerLogin<br />";
}
    ?>
ickleo    
Crewman
Crewman
 
Posts: 5
Joined: 13 May 2009, 22:22
Gender: Male
phpBB Knowledge: 1

Re: [Released] News Ticker

Postby jdrechsler » 17 Jul 2010, 17:14

I was able to make them click able.
All you have to do is

Open includes\functions.php
Find:
Code: Select all
   'NEWS_FORUM' => $config['news_forum'],
   'NEWS_WORLD' => $config['news_world'],
   'NEWS_SPORT' => $config['news_sport'],

Replace with:
Code: Select all
      'NEWS_FORUM' => html_entity_decode($config['news_forum']),
      'NEWS_WORLD' => html_entity_decode($config['news_world']),
      'NEWS_SPORT' => html_entity_decode($config['news_sport']),


However there is 1 issue of it only allows 100 characters. If you want to allow more just change this 'type' => 'text:25:100' to this 'type' => 'text:25:<how ever many you like>'
jdrechsler
Ensign
Ensign
 
Posts: 61
Joined: 27 Jun 2009, 15:42
Gender: Male
phpBB Knowledge: 4

Re: [Released] News Ticker

Postby websponge » 18 Jul 2010, 04:43

clickable? where does the link go then? its just static text written in the ACP
User avatar
websponge    
Lt. Jr Grade
Lt. Jr Grade
 
Posts: 177
Joined: 22 Mar 2007, 10:11
Favorite Team: Arsenal
Gender: Male
phpBB Knowledge: 4

Re: [Released] News Ticker

Postby jdrechsler » 18 Jul 2010, 14:57

You don't do anything different lol.
You just put in the same as if you were making a link, so in the ACP you put in

Code: Select all
<a href="http://www.google.com">Google</a>

and it gets stored like this in the database
Code: Select all
&lt;a href=&quot;www.google.com&quot;&gt;Google&lt;/a&gt;

Its just that when thats sent back to the forum, it comes out as text, it looks right but it doesn't make it HTML. The command html_entity_decode(); turns in back into HTML once it is pulled out of the database.

I am still looking for a way to move it from the ACP, so that others can update it.

Think that is possible?
I am currently looking into making a hidden div that will have the places to to enter new information and color hex, I just don't know if you can do the change from outside of the ACP.

If I can get the div working, then I just need to do the set_config function and I should be able to get it.
jdrechsler
Ensign
Ensign
 
Posts: 61
Joined: 27 Jun 2009, 15:42
Gender: Male
phpBB Knowledge: 4

Re: [Released] News Ticker

Postby jdrechsler » 20 Jul 2010, 07:37

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
jdrechsler
Ensign
Ensign
 
Posts: 61
Joined: 27 Jun 2009, 15:42
Gender: Male
phpBB Knowledge: 4

Re: [Released] News Ticker

Postby cossielee » 29 Jul 2010, 17:24

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.
cossielee    
Crewman
Crewman
 
Posts: 5
Joined: 29 Jul 2010, 17:15
Gender: Male
phpBB Knowledge: 4

Re: [Released] News Ticker

Postby big-joe pryde » 24 Aug 2010, 14:21

hi there i am using the acid tech theme with phpbb3 and have managed to get all the information to appear in my ACP but cant get it to display within the forum. heres all the code for the overall_header.html:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>

<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="content-language" content="{S_USER_LANG}" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="global" />
<meta name="copyright" content="2000, 2002, 2005, 2007 phpBB Group" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
{META}
<title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>

<!-- IF S_ENABLE_FEEDS -->
   <!-- IF S_ENABLE_FEEDS_OVERALL --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {SITENAME}" href="{U_FEED}" /><!-- ENDIF -->
   <!-- IF S_ENABLE_FEEDS_NEWS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_NEWS}" href="{U_FEED}?mode=news" /><!-- ENDIF -->
   <!-- IF S_ENABLE_FEEDS_FORUMS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_ALL_FORUMS}" href="{U_FEED}?mode=forums" /><!-- ENDIF -->
   <!-- IF S_ENABLE_FEEDS_TOPICS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_NEW}" href="{U_FEED}?mode=topics" /><!-- ENDIF -->
   <!-- IF S_ENABLE_FEEDS_TOPICS_ACTIVE --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_ACTIVE}" href="{U_FEED}?mode=topics_active" /><!-- ENDIF -->
   <!-- IF S_ENABLE_FEEDS_FORUM and S_FORUM_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FORUM} - {FORUM_NAME}" href="{U_FEED}?f={S_FORUM_ID}" /><!-- ENDIF -->
   <!-- IF S_ENABLE_FEEDS_TOPIC and S_TOPIC_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_TOPIC} - {TOPIC_TITLE}" href="{U_FEED}?f={S_FORUM_ID}&amp;t={S_TOPIC_ID}" /><!-- ENDIF -->
<!-- ENDIF -->

<link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" />

<script type="text/javascript">
// <![CDATA[
<!-- IF S_USER_PM_POPUP -->
   if ({S_NEW_PM})
   {
      popup('{UA_POPUP_PM}', 400, 225, '_phpbbprivmsg');
   }
<!-- ENDIF -->

function popup(url, width, height, name)
{
   if (!name)
   {
      name = '_popup';
   }

   window.open(url.replace(/&amp;/g, '&'), name, 'height=' + height + ',resizable=yes,scrollbars=yes,width=' + width);
   return false;
}

function jumpto()
{
   var page = prompt('{LA_JUMP_PAGE}:', '{ON_PAGE}');
   var per_page = '{PER_PAGE}';
   var base_url = '{A_BASE_URL}';

   if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0)
   {
      if (base_url.indexOf('?') == -1)
      {
         document.location.href = base_url + '?start=' + ((page - 1) * per_page);
      }
      else
      {
         document.location.href = base_url.replace(/&amp;/g, '&') + '&start=' + ((page - 1) * per_page);
      }
   }
}

/**
* Find a member
*/
function find_username(url)
{
   popup(url, 760, 570, '_usersearch');
   return false;
}

/**
* Mark/unmark checklist
* id = ID of parent container, name = name prefix, state = state [true/false]
*/
function marklist(id, name, state)
{
   var parent = document.getElementById(id);
   if (!parent)
   {
      eval('parent = document.' + id);
   }

   if (!parent)
   {
      return;
   }

   var rb = parent.getElementsByTagName('input');
   
   for (var r = 0; r < rb.length; r++)
   {
      if (rb[r].name.substr(0, name.length) == name)
      {
         rb[r].checked = state;
      }
   }
}

<!-- IF ._file -->

   /**
   * Play quicktime file by determining it's width/height
   * from the displayed rectangle area
   *
   * Only defined if there is a file block present.
   */
   function play_qt_file(obj)
   {
      var rectangle = obj.GetRectangle();

      if (rectangle)
      {
         rectangle = rectangle.split(',')
         var x1 = parseInt(rectangle[0]);
         var x2 = parseInt(rectangle[2]);
         var y1 = parseInt(rectangle[1]);
         var y2 = parseInt(rectangle[3]);

         var width = (x1 < 0) ? (x1 * -1) + x2 : x2 - x1;
         var height = (y1 < 0) ? (y1 * -1) + y2 : y2 - y1;
      }
      else
      {
         var width = 200;
         var height = 0;
      }

      obj.width = width;
      obj.height = height + 16;

      obj.SetControllerVisible(true);

      obj.Play();
   }
<!-- ENDIF -->

// ]]>
</script>


<!-- IF S_IN_ARCADE -->
   <link href="{T_THEME_PATH}/arcade.css" rel="stylesheet" type="text/css" media="screen, projection" />
<!-- ENDIF -->
</head>
<body class="{S_CONTENT_DIRECTION}">

<a name="top"></a>

<div id="wrapheader">

   <div id="logodesc">
      <table width="100%" cellspacing="0">
      <tr>
         <td><a href="{U_INDEX}">{SITE_LOGO_IMG}</a></td>
         <td width="100%" align="center"><h1>{SITENAME}</h1><span class="gen">{SITE_DESCRIPTION}</span></td>
      </tr>
      </table>
   </div>

   <div id="menubar">
      <table width="100%" cellspacing="0">
      <tr>
         <td class="genmed">
            <!-- IF not S_IS_BOT --><a href="{U_LOGIN_LOGOUT}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" alt="*" /> {L_LOGIN_LOGOUT}</a>&nbsp;<!-- ENDIF -->
            <!-- IF U_RESTORE_PERMISSIONS --> &nbsp;<a href="{U_RESTORE_PERMISSIONS}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" alt="*" /> {L_RESTORE_PERMISSIONS}</a><!-- ENDIF -->
            <!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN --> &nbsp;<span style="color: red;">{L_BOARD_DISABLED}</span><!-- ENDIF -->
            <!-- IF not S_IS_BOT -->
               <!-- IF S_USER_LOGGED_IN -->
                  <!-- IF S_DISPLAY_PM --> &nbsp;<a href="{U_PRIVATEMSGS}"><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" alt="*" /> {PRIVATE_MESSAGE_INFO}<!-- IF PRIVATE_MESSAGE_INFO_UNREAD -->, {PRIVATE_MESSAGE_INFO_UNREAD}<!-- ENDIF --></a><!-- ENDIF -->
               <!-- ELSEIF S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) --> &nbsp;<a href="{U_REGISTER}"><img src="{T_THEME_PATH}/images/icon_mini_register.gif" width="12" height="13" alt="*" /> {L_REGISTER}</a>
               <!-- ENDIF -->
            <!-- ENDIF -->
         </td>
         <td class="genmed" align="{S_CONTENT_FLOW_END}">
               <a href="{U_ARCADE}"><img src="{T_THEME_PATH}/images/icon_mini_arcade.gif" width="12" height="13" alt="*" /> {L_ARCADE}</a>&nbsp; &nbsp;
            <a href="{U_FAQ}"><img src="{T_THEME_PATH}/images/icon_mini_faq.gif" width="12" height="13" alt="*" /> {L_FAQ}</a>
            <!-- IF S_DISPLAY_SEARCH -->&nbsp; &nbsp;<a href="{U_SEARCH}"><img src="{T_THEME_PATH}/images/icon_mini_search.gif" width="12" height="13" alt="*" /> {L_SEARCH}</a><!-- ENDIF -->
            <!-- IF not S_IS_BOT -->
               <!-- IF S_DISPLAY_MEMBERLIST -->&nbsp; &nbsp;<a href="{U_MEMBERLIST}"><img src="{T_THEME_PATH}/images/icon_mini_members.gif" width="12" height="13" alt="*" /> {L_MEMBERLIST}</a><!-- ENDIF -->
               <!-- IF S_USER_LOGGED_IN -->&nbsp; &nbsp;<a href="{U_PROFILE}"><img src="{T_THEME_PATH}/images/icon_mini_profile.gif" width="12" height="13" alt="*" /> {L_PROFILE}</a><!-- ENDIF -->
            <!-- ENDIF -->
         </td>
      </tr>


      <!-- INCLUDE arcade/arcade_info_body.html -->
      </table>
   </div>

   <div id="datebar">
      <table width="100%" cellspacing="0">
      <tr>
         <td class="gensmall"><!-- IF S_USER_LOGGED_IN -->{LAST_VISIT_DATE}<!-- ENDIF --></td>
         <td class="gensmall" align="{S_CONTENT_FLOW_END}">{CURRENT_TIME}<br /></td>
      </tr>
      </table>
   </div>

</div>

<div id="wrapcentre">

   <!-- IF S_DISPLAY_SEARCH -->
   <p class="searchbar">
      <span style="float: {S_CONTENT_FLOW_BEGIN};"><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a> | <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></span>
      <!-- IF S_USER_LOGGED_IN -->
      <span style="float: {S_CONTENT_FLOW_END};"><a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a> | <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a> | <a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a></span>
      <!-- ENDIF -->
   </p>
   <!-- ENDIF -->

   <br style="clear: both;" />

   <!-- INCLUDE breadcrumbs.html -->

   <br />
   
   <table class="tablebg" width="100%" cellspacing="1" cellpadding="0" style="margin-top: 5px;">
<tr>
<td class="row1">
<p class="breadcrumbs">
<marquee behavior="scroll" direction="left" width="100%" scrollamount="3">
<font color="#{FORUM_COLOR}">{NEWS_FORUM} &nbsp </font>
<font color="#{WORLD_COLOR}">{NEWS_WORLD} &nbsp </font>
<font color="#{SPORT_COLOR}">{NEWS_SPORT}</font>
</marquee>
</p>
</td>
</tr>
</table>

<br />

big-joe pryde    
Crewman
Crewman
 
Posts: 2
Joined: 24 Aug 2010, 13:59
Gender: Male
phpBB Knowledge: 2

Re: [Released] News Ticker

Postby big-joe pryde » 24 Aug 2010, 15:37

sorry worked it out forgot to purge the cache
big-joe pryde    
Crewman
Crewman
 
Posts: 2
Joined: 24 Aug 2010, 13:59
Gender: Male
phpBB Knowledge: 2

PreviousNext

Return to phpBB3 Customizations

Who is online

Users browsing this forum: Google Adsense [Bot], psbot [Picsearch] and 9 guests

cron