I've searched the forums for any information on this and have not come across anything.
What I would like is a way for the submission of Challenges to only occur when an admin account is logged in instead of any user account.
My site is down so I can't help you too much ;/
But... I'll try ^^"
Let's see... try this:
1. BACKUP modules/challenges/challenges.php
2. FIND (around line 43)
if(($action && ($action != "add" || !$anonchallenges)) && !isMEMBER) accessDenied( );
3. CHANGE TO:
if($action != "respond" && !isADMIN) { errorExit("Only admins can add challenges" ); }
4. BACKUP modules/challenges/browse.php
5. FIND (around line 28)
$output .= "<div id='pagetitle'>"._CHALLENGES."</div><div class="respond"><a href=""modules/challenges/challenges.php?action=add">"._ISSUECHALLENGE."</a></div>".build_alphalinks("browse.php?type=challenges&"," $let);
6. CHANGE TO:
$output .= "<div id='pagetitle'>"._CHALLENGES."</div>";
if (isADMIN) $output .= "<div class="respond"><a href=""modules/challenges/challenges.php?action=add">"._ISSUECHALLENGE."</a></div>";"
$output .= build_alphalinks("browse.php?type=challenges&", $let);
I'm not sure if this will work and if this is all the changes you need to do, since my site if offline... .-.'
Post here if that worked. Hope it helps.
That worked! Or at least hasn't caused a problem yet. Thanks!
You're welcome... I'm glad it helped (:
I just saw that you need to do again the step 6, the way I wrote only admins will se the page title "Challenges". It's correct now, sorry ^^"
Thanks... I was just coming to say that I ran into the problem.
Okay... I'm running into an error with this.
I tried changing the step six code and receive the following error:
Parse error: parse error, unexpected T_STRING in /home/content/i/h/e/iheartgibbs/html/modules/challenges/browse.php on line 29
I changed the following on browse.php
if (isADMIN) $output .= "<div id='pagetitle'>"._CHALLENGES."</div><div class="respond"><a href=""modules/challenges/challenges.php?action=add">"._ISSUECHALLENGE."</a></div>";"
$output .= build_alphalinks("browse.php?type=challenges&", $let);
to
$output .= "<div id='pagetitle'>"._CHALLENGES."</div>";
if (isADMIN) $output .= "<div class="respond"><a href=""modules/challenges/challenges.php?action=add">"._ISSUECHALLENGE."</a></div>";"
$output .= build_alphalinks("browse.php?type=challenges&", $let);
Hummmm... weird, it's working fine here.
Usually "unexpected T_STRING" usually is problem with concatenation.
