Author |
Message |
Anders
Worker
![Worker Worker](modules/Forums/images/ranks/3stars.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Jun 16, 2004
Posts: 159
Location: Sweden
|
Posted:
Thu Mar 01, 2012 10:30 am |
|
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? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fkelly
Former Moderator in Good Standing
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY
|
Posted:
Thu Mar 01, 2012 10:37 am |
|
What does the notuser() function do? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
RavenNuke(tm) Development Team
![](modules/Forums/images/avatars/48fb116845dfecf66294c.gif)
Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA
|
Posted:
Thu Mar 01, 2012 10:48 am |
|
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
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();
}
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Anders
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Mar 01, 2012 11:02 am |
|
cant delete it
its still there
and notuser I dont have a clue about that i have not done the code ![Smile](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
Site Admin
![](modules/Forums/images/avatars/125904890252d880f79f312.png)
Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Thu Mar 01, 2012 3:37 pm |
|
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 |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Anders
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Mar 01, 2012 3:46 pm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Anders
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Mar 01, 2012 4:29 pm |
|
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](modules/Forums/images/smiles/icon_sad.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
killing-hours
RavenNuke(tm) Development Team
![](modules/Forums/images/avatars/18f54b284d120ece8c103.gif)
Joined: Oct 01, 2010
Posts: 438
Location: Houston, Tx
|
Posted:
Fri Mar 02, 2012 10:52 am |
|
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 |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Mar 02, 2012 12:14 pm |
|
Not sure if this will work but should get you close, at least
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&op=userinfo&username=([a-zA-Z0-9_-]*)&([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](modules/Forums/images/smiles/icon_wink.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
Site Admin
![](modules/Forums/images/avatars/0c0adf824792d6d341ef4.gif)
Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Sun Mar 11, 2012 9:52 am |
|
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! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|