SimplePortal

Support => English Support => Topic started by: Ace on September 22, 2008, 10:14:40 PM

Title: 8: Undefined index: action
Post by: Ace on September 22, 2008, 10:14:40 PM
Hi
I have this error in log can you tell me what it is and how to repair..

Quote
public_html/forum/Themes/default/SPortal.template.php (main sub template - eval?)
Line: 19
Thanks..
Title: Re: 8: Undefined index: action
Post by: ???1031 on September 23, 2008, 12:41:56 AM
Hi
I have this error in log can you tell me what it is and how to repair..

Quote
public_html/forum/Themes/default/SPortal.template.php (main sub template - eval?)
Line: 19
Thanks..

Can you quote the complete error? :)

I would like to know which variable this eval error produce.

Thanks and Bye
DIN1031
Title: Re: 8: Undefined index: action
Post by: Ace on September 23, 2008, 08:11:18 AM
8: Undefined index: action
File:/public_html/forum/Themes/default/SPortal.template.php (main sub template - eval?)
Line: 19


This is all there is thats displayed its listed 7 times
Title: Re: 8: Undefined index: action
Post by: Nathaniel on September 23, 2008, 08:39:27 PM
Do you have any edited/custom/php blocks on your forum? If so then can you please post the code for them.
Title: Re: 8: Undefined index: action
Post by: Ace on September 24, 2008, 08:12:25 AM
Do you have any edited/custom/php blocks on your forum? If so then can you please post the code for them.

Heres the scripts im using:

RANDOM GAMES:
Quote
/******************************************************************************
* Tiny Portal/SMF Arcade - Fading Random Game Block                           *
*******************************************************************************
* Version:              1.0 - for SMFARCADE V2                                  *
* File by:            Eric Lawson - www.ericsworld.eu                            *
*******************************************************************************
*                                                                             *
* To install:                                                                 *
* Copy the entire contents (crtl+a)(ctrl+c) of this file into a phpblock      *
*                                                                               *
* Edits:                                                                      *
* Change the txt 'play' to suit your language.                                *
* Set $no_of_games = <the number of games installed in your arcade            *
*                                                                             *
* You may also edit some of the java settings further down the file           *
* to change speed, text colour if you know what you are doing!                *
*                                                                             *
* This file is distributed in the hope that it is and will be useful,         *
* but WITHOUT ANY WARRANTIES; without even any implied warranty of            *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                        *
*                                                                             *
*******************************************************************************

********EDITS*****************************************************************/

$no_of_games = 25;
$txt['arcade_play']='Play';


//******NOTHING TO EDIT BELOW HERE********************************************

global $context, $txt, $modSettings, $scripturl, $db_prefix;

$no = rand(1,$no_of_games-10);

$sql = "SELECT ID_GAME, gameName, thumbnail, gameDirectory
        FROM {$db_prefix}arcade_games
        LIMIT $no,10";
$result = db_query($sql, __FILE__, __LINE__);


   $i=0;

   echo'
   <div align="center">
   <table width="100%" border="0" cellpadding="1">
   <tr>
   <td><span class="smalltext">
   <script type="text/javascript">

   /***********************************************
   * Fading Scroller- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
   * This notice MUST stay intact for legal use
   * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
   ***********************************************/

   var delay1 = 3000; //set delay between message change (in miliseconds)
   var maxsteps1=30; // number of steps to take to change from start color to endcolor1
   var stepdelay1=40; // time in miliseconds of a single step
   //**Note: maxsteps1*stepdelay1 will be total time in miliseconds of fading effect
   var startcolor1= new Array(255,255,255); // start color (red, green, blue)
   var endcolor1=new Array(0,0,0); // end color (red, green, blue)

   var fcontent1=new Array();
   begintag1=\'<div align="center"style=" padding: 5px;">\'; //set opening tag, such as font declarations
   ';
   //foreach($rg as $rg_out)
   while ($rg_out = mysql_fetch_array($result))
   {
      $gameico1 = !$rg_out['gameDirectory'] ?   $modSettings['gamesUrl'].$rg_out['thumbnail'] : $modSettings['gamesUrl'].$rg_out['gameDirectory']."/".$rg_out['thumbnail'];

      echo 'fcontent1[',$i,']="<a href=\"',$scripturl,'?action=arcade;sa=play;game=',$rg_out['ID_GAME'],'\"><img border=\"0\" src=\"',$gameico1, '\" alt=\"ico\" width=\"60\" height=\"60\" title=\"',$txt['arcade_play'],' ', $rg_out['gameName'],'\"></a><br /><br /><a href=\"',$scripturl,'?action=arcade;sa=play;game=',$rg_out['ID_GAME'],'\">',$rg_out['gameName'],'</a>";
      ';
      $i++;
   }
   echo'
   closetag1=\'</div>\';
   
   var fwidth1=\'100%\'; //set scroller width
   var fheight1=\'100px\'; //set scroller height
   var fadelinks1=1;  //should links inside scroller content also fade like text? 0 for no, 1 for yes.

   ///No need to edit below this line/////////////////

   var ie41=document.all&&!document.getElementById;
   var DOM21=document.getElementById;
   var faderdelay1=3;
   var index=0;

   /*Rafael Raposo edited function*/
   //function to change content
   function changecontent1(){
   if (index>=fcontent1.length)
   index=0
   if (DOM21){
   document.getElementById("fscroller1").style.color="rgb("+startcolor1[0]+", "+startcolor1[1]+", "+startcolor1[2]+")"
   document.getElementById("fscroller1").innerHTML=begintag1+fcontent1[index]+closetag1
   if (fadelinks1)
   linkcolorchange1(1);
   colorfade1(1, 15);
   }
   else if (ie41)
   document.all.fscroller1.innerHTML=begintag1+fcontent1[index]+closetag1;
   index++
   }

   // colorfade1() partially by Marcio Galli for Netscape Communications.  ////////////
   // Modified by Dynamicdrive.com

   function linkcolorchange1(step1){
   var obj=document.getElementById("fscroller1").getElementsByTagName("A");
   if (obj.length>0){
   for (i=0;i<obj.length;i++)
   obj.style.color=getstepcolor1(step1);
   }
   }

   /*Rafael Raposo edited function*/
   var fadecounter1;
   function colorfade1(step1) {
   if(step1<=maxsteps1) {
   document.getElementById("fscroller1").style.color=getstepcolor1(step1);
   if (fadelinks1)
   linkcolorchange1(step1);
   step1++;
   fadecounter1=setTimeout("colorfade1("+step1+")",stepdelay1);
   }else{
   clearTimeout(fadecounter1);
   document.getElementById("fscroller1").style.color="rgb("+endcolor1[0]+", "+endcolor1[1]+", "+endcolor1[2]+")";
   setTimeout("changecontent1()", delay1);
   }
   }
   function getstepcolor1(step1) {
   var diff1
   var newcolor1=new Array(3);
   for(var i=0;i<3;i++) {
   diff1 = (startcolor1-endcolor1);
   if(diff1 > 0) {
   newcolor1 = startcolor1-(Math.round((diff1/maxsteps1))*step1);
   } else {
   newcolor1 = startcolor1+(Math.round((Math.abs(diff1)/maxsteps1))*step1);
   }
   }
   return ("rgb(" + newcolor1[0] + ", " + newcolor1[1] + ", " + newcolor1[2] + ")");
   }
   if (ie41||DOM21)
   document.write(\'<div id="fscroller1" style="border:0px solid black;width:\'+fwidth1+\';height:\'+fheight1+\'"></div>\');

   if (window.addEventListener)
   window.addEventListener("load", changecontent1, false)
   else if (window.attachEvent)
   window.attachEvent("onload", changecontent1)
   else if (document.getElementById)
   window.onload=changecontent1
   </script>
   </span>
   </td>
   </tr>
   </table>
   </div>';

Total Playes:
Quote
global $db_prefix;

$request = db_query("SELECT SUM(numPlays) FROM {$db_prefix}arcade_games", __FILE__, __LINE__);
list ($plays) = mysql_fetch_row($request);
mysql_free_result($request);

echo 'Our users have played a total of ', $plays, ' games ';

Users in Arcade:
Quote
global $txt, $context,$settings, $db_prefix;
   require_once('SSI.php');

//    Heres the bullits duck lol
$bullet2 = '<img src="'.$settings['images_url'].'/aim.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
//   Its ok now bullits have flown by stand up again lol
$online = ssi_whosOnline('array');
$arcade_users = array();
foreach($online['users'] as $user)
{
   
   $result = db_query("
      SELECT url
      FROM {$db_prefix}log_online
      WHERE ID_MEMBER = $user[id]",__FILE__, __LINE__);

   $checkit = mysql_fetch_assoc($result);
   $data = @unserialize($checkit['url']);
   if($data['action']=='arcade')
   {
      echo $bullet2 , $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];  echo ' ';
      $arcade_users[] = $user;
   }
   unset($data);
}

//   No arcade users?
if(empty($arcade_users))
   echo 'no players playing at the moment';
// end wdmboard_statsonline

Link to Us:
Quote
<p align="center"><a href="http://www.mowclan.us/forum/index.php"><img src="http://www.mowclan.us/forum/images/minilogo.gif"></a><br>
<br>
<TEXTAREA id=holdtext rows=3 cols=20><p align="center"><a href="www.mowclan.us/forum/index.php"><img src="http://www.mowclan.us/forum/images/minilogo.gif"></textarea>

Arcade Hall of Fame:
Quote
function hof($count = 10, $time = - 1)
{
   global $db_prefix, $scripturl, $txt,  $modSettings;

   $where = '';

   if ($time == 'current')
      $where = 'AND championTo = 0';
   elseif ($time != -1)
      $where = "AND championFrom > $time";

   $results = db_query("
      SELECT  game.ID_GAME, game.gameName,game.thumbnail, game.gameDirectory, score.score, score.position,
         IF(championFrom > 0, (IF(championTo = 0, UNIX_TIMESTAMP(), championTo) - championFrom), 0) AS championDuration,
         IFNULL(mem.ID_MEMBER, 0) AS ID_MEMBER, IFNULL(mem.realName, '') AS realName, IF(championTo = 0, 1, 0) AS current
      FROM ({$db_prefix}arcade_scores AS score, {$db_prefix}arcade_games AS game)
         LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = score.ID_MEMBER)
      WHERE game.ID_GAME = score.ID_GAME
         $where
      HAVING championDuration > 0
      ORDER BY IF(championFrom > 0, (IF(championTo = 0, UNIX_TIMESTAMP(), championTo) - championFrom), 0) DESC
      LIMIT $count", __FILE__, __LINE__);

   $top = array();
   $max = -1;

   while ($score = mysql_fetch_assoc($results))
   {
      if ($max == -1)
         $max = $score['championDuration'];

      $top[] = array(
         'game_name' => $score['gameName'],
         'game_link' => '<a href="' . $scripturl . '?action=arcade;sa=play;game=' . $score['ID_GAME'] . '">' .  $score['gameName'] . '</a>',
         'member_name' => $score['realName'],
         'member_link' => !empty($score['realName']) ? '<a href="' . $scripturl . '?action=profile;u=' . $score['ID_MEMBER'] . '">' .  $score['realName'] . '</a>' : $txt['arcade_guest'],
         'duration' => format_time_ago($score['championDuration']),
         'precent' => ($score['championDuration'] / $max) * 100,
         'current' => $score['current'] == 1,
         'thumbnail' =>$score['gameDirectory']."/".$score['thumbnail'],
            'score' => round($score['score'],3),
      );
   }

   if (count($top) == 0)
      return false;
   elseif ($count > 1)
      return $top;
   else
      return $top[0];
}
   global $scripturl, $txt,  $boardurl, $context, $settings, $arcsettings;

$top_player = hof(10);
   $i=0; //players position
         echo '
   <table width="100%"  border="0" cellspacing="1" cellpadding="1">
       <tr>
       <td width="20%" align="center" nowrap class="titlebg">
         <b>Champion in Game</b>
       </td>
       <td width="25%" align="center" nowrap class="titlebg">
         <b>Champions Name</b>
       </td>
       <td width="15%" align="center" nowrap class="titlebg">
         <b>High Score</b>
       </td>
       <td width="20%" align="center" nowrap class="titlebg">
         <b>Champion Since</b>
       </td>
       </tr>
      </table>';
     foreach ($top_player as $row)
      {
         echo '
<table width="100%" border="0" cellspacing="1" cellpadding="4">
    <tr>
      <td align="left" width="20%" class="windowbg">
          <img src="',$boardurl,'/','Games',$row['gameDirectory']."/".$row['thumbnail'],'"></a>  ', $row['game_link'],'<br/>
        </td>
      <td align="center" width="25%" nowrap class="windowbg2">
          ', $row['member_link'],'
        </td>
      <td align="center" width="15%" nowrap="nocrap" class="windowbg">
          ', $row['score'],'
        </td>
      <td align="center" width="20%" class="windowbg2">
        ', $row['duration'],'
        
     </td>
   </tr>
   ';
     $i++;
      }
      echo '
</table>';

Chess:
Quote
global $scripturl, $context;
echo '
<img src="/chessblock/chess.png"/> <a href="', $scripturl ,'?action=chess"><font size="2">My Chess Stats</font></a> |
<img src="/chessblock/challenge.png"/> <a href="', $scripturl ,'?action=chess;u=', $context['user']['id'] ,';sa=challenge"><font size="2">Challenge</font></a> |
<img src="/chessblock/matches.png"/> <a href="', $scripturl ,'?action=chess;u=', $context['user']['id'] ,';sa=current"><font size="2">Current Matches</font></a> |
<img src="/chessblock/matches.png"/> <a href="', $scripturl ,'?action=chess;u=', $context['user']['id'] ,';sa=finished"><font size="2">Finished Matches</font></a> |
<img src="/chessblock/leader.png"/> <a href="', $scripturl ,'?action=chess;u=', $context['user']['id'] ,';sa=leaderboard"><font size="2">Leaderboard</font></a>
';

These are ALL php scripts
EXCEPT LINK TO US this is HTML





Title: Re: 8: Undefined index: action
Post by: Nathaniel on September 24, 2008, 08:27:56 AM
The issue is with your "Users In Arcade" block, try the code below. It checks to see that the $data['action'] variable is set, that should remove the error.

Code: [Select]
global $txt, $context,$settings, $db_prefix;
   require_once('SSI.php');

//    Heres the bullits duck lol
$bullet2 = '<img src="'.$settings['images_url'].'/aim.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
//   Its ok now bullits have flown by stand up again lol
$online = ssi_whosOnline('array');
$arcade_users = array();
foreach($online['users'] as $user)
{
   
   $result = db_query("
      SELECT url
      FROM {$db_prefix}log_online
      WHERE ID_MEMBER = $user[id]",__FILE__, __LINE__);

   $checkit = mysql_fetch_assoc($result);
   $data = @unserialize($checkit['url']);
   if(!empty($data['action']) && ($data['action']=='arcade'))
   {
      echo $bullet2 , $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];  echo ' ';
      $arcade_users[] = $user;
   }
   unset($data);
}

//   No arcade users?
if(empty($arcade_users))
   echo 'no players playing at the moment';
// end wdmboard_statsonline
Title: Re: 8: Undefined index: action
Post by: Ace on September 24, 2008, 08:46:56 AM
The issue is with your "Users In Arcade" block, try the code below. It checks to see that the $data['action'] variable is set, that should remove the error.

Code: [Select]
global $txt, $context,$settings, $db_prefix;
   require_once('SSI.php');

//    Heres the bullits duck lol
$bullet2 = '<img src="'.$settings['images_url'].'/aim.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
//   Its ok now bullits have flown by stand up again lol
$online = ssi_whosOnline('array');
$arcade_users = array();
foreach($online['users'] as $user)
{
   
   $result = db_query("
      SELECT url
      FROM {$db_prefix}log_online
      WHERE ID_MEMBER = $user[id]",__FILE__, __LINE__);

   $checkit = mysql_fetch_assoc($result);
   $data = @unserialize($checkit['url']);
   if(!empty($data['action']) && ($data['action']=='arcade'))
   {
      echo $bullet2 , $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];  echo ' ';
      $arcade_users[] = $user;
   }
   unset($data);
}

//   No arcade users?
if(empty($arcade_users))
   echo 'no players playing at the moment';
// end wdmboard_statsonline

Ok thanks
I seem to have no errors in log now....
Title: Re: 8: Undefined index: action
Post by: Ace on September 24, 2008, 08:56:25 AM
ive rechecked my logs again and still no errors your fixer upper worked thanks again... :applause: :applause: :applause:
Title: Re: 8: Undefined index: action
Post by: Nathaniel on September 24, 2008, 08:57:53 AM
Thats good to hear. :D
Title: Re: 8: Undefined index: action
Post by: Jakki on September 24, 2008, 12:45:28 PM
Thanks I was just reading this and this solved my issue also.
SimplePortal 2.3.8 © 2008-2024, SimplePortal