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
Anders
Worker
Worker


Joined: Jun 16, 2004
Posts: 157
Location: Sweden

PostPosted: Thu Mar 01, 2012 10:30 am Reply with quote

In your account i have a opption to delete submited scores it did work on my old site but on this new 1 i have problem i think its this code that dont work!

Code:
if (!defined('RNYA')) {

   header('Location: ../../../index.php');
   die();
}
getusrinfo($user);
if (!is_user($user)) notuser();
$sid = intval($_GET['sid']);
cookiedecode($user);

$db->sql_query("DELETE FROM ".$prefix."_sh_scores WHERE sid='$sid' AND userid='".$cookie[0]."'");
header("Location: modules.php?name=$module_name&op=userinfo&username=".$cookie[1]."&".rand(1000,999999)."#scores");


any that have a clue what wrong?
 
View user's profile Send private message
fkelly
Former Moderator in Good Standing


Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Thu Mar 01, 2012 10:37 am Reply with quote

What does the notuser() function do?
 
View user's profile Send private message Visit poster's website
spasticdonkey
RavenNuke(tm) Development Team


Joined: Dec 02, 2006
Posts: 1692
Location: Texas, USA

PostPosted: Thu Mar 01, 2012 10:48 am Reply with quote

I will add that some of those functions should only be executed for users, regardless of what some of your custom functions are doing. This assumes that only users will need to delete scores, and I have no idea what notuser() does or if this will work Smile

Code:
if (is_user($user)) {

  getusrinfo($user);
  $sid = intval($_GET['sid']);
  cookiedecode($user);

  $db->sql_query("DELETE FROM ".$prefix."_sh_scores WHERE sid='$sid' AND userid='".$cookie[0]."'");
  header("Location: modules.php?name=$module_name&op=userinfo&username=".$cookie[1]."&".rand(1000,999999)."#scores");
}else{
  notuser();
}
 
View user's profile Send private message Visit poster's website
Anders
PostPosted: Thu Mar 01, 2012 11:02 am Reply with quote

cant delete it
its still there
and notuser I dont have a clue about that i have not done the code Smile
 
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6792
Location: Ha Noi, Viet Nam

PostPosted: Thu Mar 01, 2012 3:37 pm Reply with quote

Is this for a third party module, if so I'll move the post to the modules forum since this code doesn't relate to RN 2.5
 
View user's profile Send private message Send e-mail
Anders
PostPosted: Thu Mar 01, 2012 3:46 pm Reply with quote

yes it is so move it
 
Anders
PostPosted: Thu Mar 01, 2012 4:29 pm Reply with quote

solved it was the dam short link that i had activate
i did deactivate it and now all is ok..bad b4 i like the short links and i dont understand how to fix it Sad
 
killing-hours
RavenNuke(tm) Development Team


Joined: Oct 01, 2010
Posts: 438
Location: Houston, Tx

PostPosted: Fri Mar 02, 2012 10:52 am Reply with quote

Tap the link for the module in the shortlinks file as well as the .htaccess. It "seems" complicated... but once you see how it's done... it's pretty easy to do.

_________________
Money is the measurement of time - Me
"You can all go to hell…I’m going to Texas" -Davy Crockett 
View user's profile Send private message
spasticdonkey
PostPosted: Fri Mar 02, 2012 12:14 pm Reply with quote

Not sure if this will work but should get you close, at least Smile

Step 1
Add to htaccess at the top of the your account rewrites. Note that you do not always place them at the top, but this time it is appropriate. The order of the rewrites is important and you usually start with the longest url's first.
.htaccess
Code:
#Your_Account

RewriteRule ^userinfo-([a-zA-Z0-9_-]*)-([0-9]*).html#scores modules.php?name=Your Account&op=userinfo&username=$1&$2#scores [L]

note I added a space in Your_Account to keep this site from mangling the code.

Step 2
Place your rewrites at the top of $urlin and $urlout in ShortLinks/GT-Your_Account.php. Note that you do not always place them at the top, but this time it is appropriate. The order of the rewrites is important and you usually start with the longest url's first.
Code:
$urlin = array(

'"(?<!/)modules.php\?name=Your_Account&amp;op=userinfo&amp;username=([a-zA-Z0-9_-]*)&amp;([0-9]*)#scores"',


Code:
$urlout = array(

'userinfo-\\1-\\2.html#scores',


Step 3
If these links are presented in a block create ShortLinks/GTB-block-YOURBLOCK.php where "YOURBLOCK" is the name of your block and use the same rewrites in Step 2. Make sure to insert above any existing rewrites for userinfo

Step 4
If these links appear in multiple areas of the site edit ShortLinks/GTZ-PageTap.php and use the same rewrites in Step 2. You can skip step 3 if you do this. Make sure to insert above any existing rewrites for userinfo

Let us know how you make out with this Wink
 
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9449
Location: Arizona

PostPosted: Sun Mar 11, 2012 9:52 am Reply with quote

spasticdonkey, nicely done!

_________________
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! 
View user's profile Send private message Visit poster's website
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 ©