Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 06-06-2009, 03:41 PM
FBFKids FBFKids is offline
Member
 
Join Date: Jun 2009
Posts: 11
Credits: 1,927
FBFKids
Default Link questions

Is it possible to put a link on the menu only visible to admins?

Such as a link to the administration area.
Reply With Quote
  #2  
Old 06-06-2009, 03:47 PM
Seapyramid Seapyramid is offline
Premium Member
 
Join Date: Feb 2009
Posts: 373
Gender: Female
Credits: 20,884
Seapyramid
Default RE: Link questions

Users you are not authorized to access the admin area with get an error if they click on the admin link so it really can be placed anywhere
Reply With Quote
  #3  
Old 06-06-2009, 03:59 PM
Bloodrun's Avatar
Bloodrun Bloodrun is offline
I am, who I am.
 
Join Date: Apr 2009
Posts: 532
Gender: Male
Credits: 44,158
Bloodrun
Send a message via Yahoo to Bloodrun
Default RE: Link questions

Yes there is go to your functions.php page and in your sidebar function place this(right before the $sidebar = "):

PHP Code:
$group getgroup();
$cancp cancp($group);

if(
$cancp == "yes"){
$admin "<a href='admin.php'><b>ACP</b></a><br>";
}
else{
$admin "";

Then within the &sidebar = ", place this:

PHP Code:
".$admin." 
Hope I answered your question.
Reply With Quote
  #4  
Old 06-06-2009, 04:22 PM
FBFKids FBFKids is offline
Member
 
Join Date: Jun 2009
Posts: 11
Credits: 1,927
FBFKids
Default RE: Link questions

@ Seapyramid. I know they can't access it, and that's not the issue, I'd just like that button to not even be there for them, as it might lead to confusion.

@Bloodrun. That gave me the white screen of death. :/

PHP Code:
$group getgroup();
$cancp cancp($group);

if(
$cancp == "yes"){
$admin "<a href='admin.php'><b>ACP</b></a><br>";
}
else{
$admin "";


$sidebar "<b><u>".$loggedinname."'s Links:</u></b><br><br>
<a href='adopt.php'>Adopt Some Pets</a><br>
<a href='myadopts.php'>Manage Adoptables</a><br>
<a href='account.php'>Go to My Account</a><br>
"
.$msgctr."
<a href='logout.php'>Log Out</a>"
;
".$admin." 


Is this right?
Reply With Quote
  #5  
Old 06-06-2009, 04:31 PM
Bloodrun's Avatar
Bloodrun Bloodrun is offline
I am, who I am.
 
Join Date: Apr 2009
Posts: 532
Gender: Male
Credits: 44,158
Bloodrun
Send a message via Yahoo to Bloodrun
Default RE: Link questions

Quote:
Originally Posted by FBFKids
@ Seapyramid. I know they can't access it, and that's not the issue, I'd just like that button to not even be there for them, as it might lead to confusion.

@Bloodrun. That gave me the white screen of death. :/

PHP Code:
$group getgroup();
$cancp cancp($group);

if(
$cancp == "yes"){
$admin "<a href='admin.php'><b>ACP</b></a><br>";
}
else{
$admin "";


$sidebar "<b><u>".$loggedinname."'s Links:</u></b><br><br>
<a href='adopt.php'>Adopt Some Pets</a><br>
<a href='myadopts.php'>Manage Adoptables</a><br>
<a href='account.php'>Go to My Account</a><br>
"
.$msgctr."
<a href='logout.php'>Log Out</a>"
;
".$admin." 


Is this right?

You didn't end the &sidebar correctly

the ".$admin." goes within the ($sidebar = " ";)
Reply With Quote
  #6  
Old 06-06-2009, 04:55 PM
FBFKids FBFKids is offline
Member
 
Join Date: Jun 2009
Posts: 11
Credits: 1,927
FBFKids
Default RE: Link questions

So $sidebar = "<b><u>$admin."

???
Reply With Quote
  #7  
Old 06-06-2009, 05:01 PM
Bloodrun's Avatar
Bloodrun Bloodrun is offline
I am, who I am.
 
Join Date: Apr 2009
Posts: 532
Gender: Male
Credits: 44,158
Bloodrun
Send a message via Yahoo to Bloodrun
Default RE: Link questions

Quote:
Originally Posted by FBFKids
So $sidebar = "<b><u>$admin."

???
Use this:

PHP Code:
$group getgroup();
$cancp cancp($group);

if(
$cancp == "yes"){
$admin "<a href='admin.php'><b>ACP</b></a><br>";
}
else{
$admin "";


$sidebar "<b><u>".$loggedinname."'s Links:</u></b><br><br>
<a href='adopt.php'>Adopt Some Pets</a><br>
<a href='myadopts.php'>Manage Adoptables</a><br>
<a href='account.php'>Go to My Account</a><br>
"
.$msgctr."
<a href='logout.php'>Log Out</a>
"
.$admin."";


Reply With Quote
  #8  
Old 06-06-2009, 05:13 PM
FBFKids FBFKids is offline
Member
 
Join Date: Jun 2009
Posts: 11
Credits: 1,927
FBFKids
Default RE: Link questions

Thank you, works great now.
Reply With Quote
  #9  
Old 06-06-2009, 05:15 PM
Bloodrun's Avatar
Bloodrun Bloodrun is offline
I am, who I am.
 
Join Date: Apr 2009
Posts: 532
Gender: Male
Credits: 44,158
Bloodrun
Send a message via Yahoo to Bloodrun
Default RE: Link questions

Quote:
Originally Posted by FBFKids
Thank you, works great now.
Your welcome. =D
Reply With Quote
  #10  
Old 07-18-2009, 12:21 AM
arlecchina arlecchina is offline
Member
 
Join Date: Feb 2009
Posts: 65
Credits: 4,829
arlecchina
Default RE: Link questions

I searched the Forums and this was the most relevant topic I could find so I am posting this here.

I am trying to create links in the links bar that are only visible to users when logged in.

First I commented out this so that it wouldn't pull links from the database.
PHP Code:
/*
$links = "";

    $query = "SELECT * FROM ".$prefix."links ORDER BY id ASC";
    $result = mysql_query($query);
    $num = mysql_numrows($result);

    //Loop out code
    $i=0;
    while ($i < $num) {

    $linktext=@mysql_result($result,$i,"linktext");
    $linkurl=@mysql_result($result,$i,"linkurl");

    $linktext = stripslashes($linktext);

    $links = $links."<li><a href='".$linkurl."'>".$linktext."</a></li>";

    $i++;
    }
*/ 
Then I added this after right before $links:
PHP Code:
if($isloggedin == "yes"){
    
$royallinks "
        <li><a href='pages.php?page=royals'>My Royals</a>
        <ul>
            <li><a href='adopt.php'>Adopt a Royal</a></li>
            <li><a href='myadopts.php'>Care for Royals</a></li>
            <li><a href='promo.php'>Rare Royals</a></li>
        </ul>
        </li>
    "
;
}

else{
    
$royallinks "";


if(
$isloggedin == "yes"){
        
$accountlinks "
        <li><a href='account.php'>Account</a>
        <ul>
            <li><a href='profile.php?user="
.$username."'>View Profile</a></li>
            <li><a href='account.php?act=changeemail'>Change Email</a></li>
            <li><a href='account.php?act=changepass'>Change Password</a></li>
            <li><a href='forgotpass.php'>Reset Password</a></li>
            <li><a href='account.php?act=changesettings'>Settings</a></li>
        </ul>
        </li>"
;
}

else{
    
$accountlinks "";
}

if(
$isloggedin == "yes"){
    
$pmlinks ="
        <li><a href='messages.php'>Inbox</a></li>
        <li><a href='messages.php?act=send'>Compose Message</a></li>"
;
}

else{
    
$pmlinks ="";

Then I added all my menu links (I am using a drop-down menu which is working fine):
PHP Code:
$links "<ul id='nav' class='dropdown dropdown-horizontal'>
    <li><a href='index.php'>Home</a></li>

    <li><a href='pages.php?page=about'>About</a>
    <ul>
        <li><a href='pages.php?page=stages'>Stages</a></li>
        <li><a href='pages.php?page=predators'>Predators</a></li>
        <li><a href='pages.php?page=npcs'>NPCs</a></li>
        <li><a href='pages.php?page=environment'>Environment</a></li>
        <li><a href='pages.php?page=occupations'>Occupations</a></li>
    </ul>
    </li>

    "
.$royallinks."
    "
.$accountlinks."
    <li><a href='pages.php?page=communication'>Communication</a>
    <ul>
        <li><a href='site_news.php'>Announcements</a></li>
    "
.$pmlinks."
        <li><a href='stats.php'>Form Alliances</a></li>
        <li><a href='profile.php?user='>Members</a></li>
    </ul>
    </li>

    <li><a href='pages.php?page=premium'>Premium Members</a>
    <ul>
        <li><a href='pages.php?page=donate'>Premium Royals</a></li>
        <li><a href='pages.php?page=custom'>Custom Royals</a></li>
        <li><a href='pages.php?page=sponsor'>Become a Sponsor</a></li>
    </ul>
    </li>

    <li><a href='pages.php?page=help'>Help</a>
    <ul>
        <li><a href='pages.php?page=faq'>FAQ</a></li>
        <li><a href='pages.php?page=rules'>Rules & Guidelines</a></li>
        <li><a href='tos.php'>Terms of Service</a></li>
        <li><a href='pages.php?page=privacy'>Privacy Policy</a></li>
        <li><a href='pages.php?page=safety'>Safety Tips</a></li>
        <li><a href='pages.php?page=parents'>Info for Parents</a></li>
        <li><a href='contactus.php'>Contact Us</a></li>
    </ul>
    </li>
</ul>"

What is NOT working is that even when LOGGED IN the user-only links are still NOT visible. What am I doing wrong? Please advise. Thank you!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Link Dots voni Questions and Supports 6 05-13-2014 10:20 AM
Link MaximumRide Questions and Supports 6 04-23-2012 04:52 PM
how change this link ? :( kratosvr Questions and Supports 5 08-24-2011 09:09 AM
PHP in a link? Saphira Questions and Supports 9 01-31-2009 11:30 AM
Forums Link Ashje Questions and Supports 2 01-24-2009 12:28 AM


All times are GMT -5. The time now is 06:10 PM.

Currently Active Users: 4076 (0 members and 4076 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636