Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
pnclthnmstsh
Regular
Regular


Joined: Oct 23, 2005
Posts: 54
Location: Portland, Or

PostPosted: Sun May 10, 2009 5:24 pm Reply with quote

I know this one could be asking alot, but here goes.

After submitting a comment the addon is supposed to redirect you back to the game your were playing...which it tries to do...but I get this instead of a working URL
Code:
http://huppydog.com/modules.php?name=Forums&file=games&gid=65

I've mustered up all my old limited skills and can't find how to get the amps out of the URL.

Thanks for any suggestions!

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website Yahoo Messenger
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

PostPosted: Sun May 10, 2009 5:36 pm Reply with quote

I don't know where you would put this in the code, but use
html_entity_decode Only registered users can see links on this board! Get registered or login!

_________________
- Only registered users can see links on this board! Get registered or login! -

Need help? Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
nuken
RavenNuke(tm) Development Team


Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Sun May 10, 2009 5:40 pm Reply with quote

If you could paste the mod code dealing with it, that would help. It should be as simple as removing the amp; from the file.

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Send e-mail Visit poster's website
pnclthnmstsh
PostPosted: Sun May 10, 2009 6:07 pm Reply with quote

Here's the install txt
Code:
#

#-----[ OPEN ]----------------------------------------
#
modules/Forums/games.php

#
#-----[ FIND ]----------------------------------------
#

require_once('includes/bbcode.'. $phpEx);
#
#-----[ AFTER, ADD ]-----------------------------------
#

include("includes/functions_post.php");

#
#-----[ FIND ]----------------------------------------
#
$template->set_filenames(array(
   'body' => 'games_body.tpl')
);
      
#
#-----[ AFTER, ADD ]-----------------------------------
#

generate_smilies('inline', PAGE_POSTING);      

   
#
#-----[ FIND ]----------------------------------------
#

      'GAMEHASH' => $gamehash_id,
   
#
#-----[ AFTER, ADD ]-----------------------------------
#
      'GID'=>$gid,
      'USER_ID'=> $userdata['user_id'],
      'URL_POST_THREAD'=> append_sid("arcade_gamethread?mode=insert"),
   
#
#-----[ FIND ]----------------------------------------
#

include($phpbb_root_path . 'whoisplaying.'.$phpEx);

#
#-----[ BEFORE, ADD ]---------------------------------
#

//Arcade Thread Mod - Start

require_once("includes/bbcode.php");
$sql="SELECT gt.* ,u.username FROM ".$prefix."_bbarcade_message gt left join ".USERS_TABLE." u on u.user_id=gt.user_id WHERE gt.game_id=$gid ORDER BY gt.message_date DESC LIMIT 0,10";
$result=$db->sql_query($sql);
$adminlink="";
if (!$db->sql_numrows()) {
    $template->assign_block_vars('nogamethread',array());
}else
while($row=$db->sql_fetchrow($result)){
   $bbuid=make_bbcode_uid();
   if ($userdata["user_level"]==ADMIN) {
       $adminlink="<nobr>&nbsp;[&nbsp;<a href='".append_sid("arcade_gamethread?mode=delete&gid=$gid&mid=".$row["message_id"])."'>del</a>&nbsp;]</nobr>";
   }

   $template->assign_block_vars('gamethread',array(
      'POSTER' => "<nobr><a href='".append_sid("profile.$phpEx?mode=viewprofile&u=".$row["user_id"])."'>".$row["username"]."</a></nobr>",
      'ADMINLINK' =>$adminlink,
         'POSTDATE' => create_date( $board_config['default_dateformat'] , $row["message_date"] , $board_config['board_timezone'] ),
         'MESSAGE' => nl2br( smilies_pass(bbencode_second_pass(bbencode_first_pass($row["message"],$bbuid),$bbuid))))
      );

}

//Arcade Thread Mod - End
#
#-----[ OPEN ]----------------------------------------
#

modules/Forums/templates/subSilver/games_body.tpl
or/and themes/YOURTHEME/forums/games_body.tpl

#
#-----[ FIND ]----------------------------------------
#

</script>

#
#-----[ BEFORE, ADD ]---------------------------------
#

function emoticon(text) {
   text = ' ' + text + ' ';
   if (document.post.message.createTextRange && document.post.message.caretPos) {
      var caretPos = document.post.message.caretPos;
      caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
      document.post.message.focus();
   } else {
   document.post.message.value  += text;
   document.post.message.focus();
   }
}

#
#-----[ FIND ]----------------------------------------


{WHOISPLAYING}


#
#-----[ BEFORE, ADD ]-----------------------------------
#

<!-- Game Thread MOD-->
  <table  width="99%" align="center" class="bodyline" cellpadding="2" cellspacing="1" >
   <tr>
      <th colspan="2" class="thTop" height="28" align="center">{L_GAME} Player's messages</th>
   </tr>
       <!-- BEGIN nogamethread -->
   <tr>
      <td colspan="2">
         <table width='100%'  class="bodyline" cellpadding="5" cellspacing="1">
            <tr>
               <td class='row1' align='center'><em>There is no Player's message for this game.</em><br>You can add a message in the box below.</td>
            </tr>
         </table>
      </td>
   </tr>
      <!-- END nogamethread -->
      <!-- BEGIN gamethread -->
   <tr>
      <td colspan="2">
         <table width='100%'  class="bodyline" cellpadding="5" cellspacing="1">
            <tr>
               <td width='180' class='row2'>From {gamethread.POSTER}<br>on {gamethread.POSTDATE}</td>
               <td class='row1'>{gamethread.MESSAGE}</td>
               <td class='row2' width='40'>{gamethread.ADMINLINK}</td>
            </tr>
         </table>
      </td>
   </tr>
   <!-- END GAMETHREAD -->
   <tr>
      <td  valign="middle" align="center" > <br />
           <table width="100" border="0" cellspacing="0" cellpadding="5">
            <tr align="center">
              <td colspan="{S_SMILIES_COLSPAN}" class="gensmall"><b>{L_EMOTICONS}</b></td>
            </tr>
            <!-- BEGIN smilies_row -->
            <tr align="center" valign="middle">
              <!-- BEGIN smilies_col -->
              <td><img src="{smilies_row.smilies_col.SMILEY_IMG}" border="0" onmouseover="this.style.cursor='hand';" onclick="emoticon('{smilies_row.smilies_col.SMILEY_CODE}');" alt="{smilies_row.smilies_col.SMILEY_DESC}" title="{smilies_row.smilies_col.SMILEY_DESC}" /></a></td>
              <!-- END smilies_col -->
            </tr>
            <!-- END smilies_row -->
            <!-- BEGIN switch_smilies_extra -->
            <tr align="center">
              <td colspan="{S_SMILIES_COLSPAN}"><span  class="nav"><a href="{U_MORE_SMILIES}" onclick="window.open('{U_MORE_SMILIES}', '_phpbbsmilies', 'HEIGHT=300,resizable=yes,scrollbars=yes,WIDTH=250');return false;" target="_phpbbsmilies" class="nav">{L_MORE_SMILIES}</a></span></td>
            </tr>
            <!-- END switch_smilies_extra -->
           </table>
         </td>
      <td align="center">
          <form action='{URL_POST_THREAD}' method='POST' name='post'>
            <input type="hidden" name="gid" value="{GID}">
            <input type="hidden" name="uid" value="{USER_ID}">
            <textarea class="post" name="message"  cols="100" rows="10"></textarea>
            <br><br><input type="submit" value="Add Message">
         </form>
      </td>
   </tr>
  </table>
<!-- Game Thread MOD-->

#
#-----[ OPEN ]----------------------------------------
#

modules/Forums/comments_new.php

#
#-----[ FIND ]----------------------------------------



$sql = "SELECT game_highuser

#
#-----[ INLINE AFTER, ADD ]---------------------------

, game_highscore

#
#-----[ FIND ]----------------------------------------


   $sql = "UPDATE " . COMMENTS_TABLE . " SET comments_value = '$comment_text' WHERE game_id = $game_id";

#
#-----[ BEFORE ADD ]----------------------------------


    $message="[ [u]New High-Score:[/u] [b]".$row["game_highscore"]."[/b] ]\n\n".$comment_text;
         $sql = "INSERT INTO ".$prefix."_bbarcade_message (message_id,game_id,user_id,message_date,message) "
              ."VALUES(null,$game_id,$user_id,".time().",'$message')";
   
         if (!($result = $db->sql_query($sql))) {
            message_die(GENERAL_ERROR, "Error inserting game's message", '', __LINE__, __FILE__, $sql);
         }

#
#-----[ OPEN ]----------------------------------------
#

modules/Forums/commentspopup_new.php

#
#-----[ FIND ]----------------------------------------



$sql = "SELECT game_highuser

#
#-----[ INLINE AFTER, ADD ]---------------------------

, game_highscore

#
#-----[ FIND ]----------------------------------------


   $sql = "UPDATE " . COMMENTS_TABLE . " SET comments_value = '$comment_text' WHERE game_id = $game_id";

#
#-----[ BEFORE ADD ]----------------------------------


    $message="[ [u]New High-Score:[/u] [b]".$row["game_highscore"]."[/b] ]\n\n".$comment_text;
         $sql = "INSERT INTO ".$prefix."_bbarcade_message (message_id,game_id,user_id,message_date,message) "
              ."VALUES(null,$game_id,$user_id,".time().",'$message')";
   
         if (!($result = $db->sql_query($sql))) {
            message_die(GENERAL_ERROR, "Error inserting game's message", '', __LINE__, __FILE__, $sql);
         }

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------


And the file included

Code:
<?php


/**
 *
 *   FILE: arcade_game_thread.php
 *  Author: Rica http://www.thehorde.be
 * 
 **/

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}
define('IN_PHPBB', true);
if ($popup != "1") {
   $module_name = basename(dirname(__FILE__));
   require("modules/".$module_name."/nukebb.php");
} else {
   $phpbb_root_path = 'modules/Forums/';
}
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_POSTING, $nukeuser);
init_userprefs($userdata);
//
// End session management
//
//
// Start auth check
//
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";

if ( !$userdata['session_logged_in'] ) {
      header($header_location . append_sid("login.$phpEx", true));
      exit;
}
//
// End of auth check
//
$game_id = intval($HTTP_POST_VARS['gid']);
if (!$game_id) $game_id=intval($HTTP_GET_VARS['gid']);
if ($HTTP_GET_VARS['mode']=='insert') {
   
   
   $user_id = intval($HTTP_POST_VARS['uid']);
   $message=$HTTP_POST_VARS['message'];
   $message=preg_replace(array('#&(?!(\#[0-9]+;))#', '#<#', '#>#'), array('&amp;', '&lt;', '&gt;'),$message);
   $user_idlogged = $userdata['user_id'];
   
   if ($user_idlogged<>$user_id || !$game_id || !$user_id) {
          echo "There is a problem here....<br>";
          die("Hack Attempt");
   }
   global $prefix;
   $sql = "INSERT INTO ".$prefix."_bbarcade_message (message_id,game_id,user_id,message_date,message) "
        ."VALUES(null,$game_id,$user_id,".time().",'$message')";
    
   if (!($result = $db->sql_query($sql))) {
         message_die(GENERAL_ERROR, "Error inserting game's message", '', __LINE__, __FILE__, $sql);
   }
}elseif ($HTTP_GET_VARS['mode']=='delete') {
   if ($userdata["user_level"]==ADMIN) {
      $mid=intval($HTTP_GET_VARS['mid']);
      $sql="DELETE FROM ".$prefix."_bbarcade_message WHERE message_id='$mid'";
      if (!$mid or !($result = $db->sql_query($sql))) {
         message_die(GENERAL_ERROR, "Error deleting game's message", '', __LINE__, __FILE__, $sql);
       }
   }
}
header($header_location . append_sid("games?gid=$game_id"));
exit;
?>


After reading about the entity thing. It could be an include not cooperating with RN on how to handle the amps. I'll look for that too while I'm scratching Razz

Thanks again
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©