close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Adding custom PHP

Thread began 3/15/2010 1:59 pm by rdream188601 | Last modified 3/16/2010 4:20 pm by Jimmy Wu | 750 views | 5 replies |

rdream188601

Adding custom PHP

I want to add a Admin link (for users log in as administrators) and a Order History link (for users log in as, well users).

I only want them to appear when users are logged in.

I have and extension subscription. But I was wondering if there is just and easy code to insert on the template files.

Thanks

Sign in to reply to this post

Jimmy Wu

As for the order history page, this is already created for you. To view the order history page, the user has to verify their email first. As for the admin login, the users for the admin and the front end are not linked, so you will not have a single login that is created for both the frontend and the backend, so you'd have to create that functionality before creating a backend login from the frontend of the store.

Sign in to reply to this post

rdream188601

Ok that was confusing :)

Alright let me ask the question better:

When a administrator logs in I want him to see a link to the Admin section. When a customer/user login in, I dont want to him to see the link to the Admin section.

basically:

If user logged in & administrator { Show Link } else { Do not show link }

I just need the PHP code for that.

Sign in to reply to this post

Jimmy Wu

Ah, sorry about that, I was actually thinking about PowerStore 2 when I said that. To get a link to the admin pages, you would want to modify the links like this:

php:
<?php if(isset($_SESSION["UserID"])) { ?>

      <a href="<?php echo($assumedRoot); ?>users_Profile.php">My Profile</a>
      <a href="<?php echo($assumedRoot); ?>users_LogOut.php">Log out</a>
      <?php
          
if(isset($_SESSION["UserGroupID"] && $_SESSION["UserGroupID"] > 1) {?><a href="<?php echo($assumedRoot); ?>Admin/">Admin</a><?php }
      } else { 
?>
      <a href="<?php echo($assumedRoot); ?>users_LogIn.php">Login</a>
      <a href="<?php echo($assumedRoot); ?>users_Registration.php">Register</a>
      <?php ?>
      <?php if(isset($_SESSION["WA_Store_Cart_Items"]) && $_SESSION["WA_Store_Cart_Items"] != "") { ?>
      <a href="<?php echo($assumedRoot); ?>cart.php">View Cart</a>
      <?php ?>



let me know if that works for you.

Sign in to reply to this post

rdream188601

Thanks :)
Ill try it out

Sign in to reply to this post

Jimmy Wu

Let me know if it works or not. Logging in to the frontside pages will not automatically log you in to the admin pages even if you are an admin. The admin link will only link you to the admin pages so you can log in.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...