Create page on admin & hide record with same name

9 posts by 4 authors in: Forums > CMS Builder
Last Post: September 13, 2012   (RSS)

By jimmy.g - July 16, 2012

Hi everyone,

So I've few questions
1: How can I add new page on administration and showing the record of the current logged person or showing something else.
eg: showing this http://equipegalvan.com/liste_vitrine.php but onto the administration itself (because for now this page is accessible for everyone and i don't want that)

2: On this page again http://equipegalvan.com/liste_vitrine.php there're multiple record with the same Adress name. What I want is to show only one and hide multiple other record with the same name is this possible ?

sorry for my english I thank you for your help and hope you understand what's my problem

Re: [jimmy.g] Create page on admin & hide record with same name

By Jason - July 16, 2012

Hi,

For your first question, do you want to show one thing if the user is logged in, and something else if they're not?

If so, try something like this:

<?php if ($CURRENT_USER): ?>
//output content for logged in user
<?php else: ?>
//output content for not logged in user
<?php endif ?>


For your second question, you could maintain a list of outputted addresses and skip any that are the same:

EXAMPLE (you'll need to change variable names to match what's in your php file)

<?php $outputtedAddress = array(); ?>

<?php foreach ($listingRecords as $listing): ?>
<?php if (in_array($listings['address'], $outputtedAddress)) { continue; } ?>
<?php $outputtedAddress[] = $listings['address']; ?>

//output your listing here

<?php endforeach ?>


Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Create page on admin & hide record with same name

By jimmy.g - July 16, 2012

Hi,
for my second question it worked like a charm thank you.
Now for my first question i'd like to know how can I add more page on CMSBuilder administration
by example I want to add this page http://equipegalvan.com/liste_vitrine.php on the administration panel instead of a non password protected page.
I want to know how to do this to make some report page or adding external script on the administration panel itself (by example a form script to lets realtor sending email to people by the administration of the web-site

hope you understand thanks in advance for your help
bye

Re: [jimmy.g] Create page on admin & hide record with same name

By Jason - July 18, 2012

Hi,

Are you looking for a way to view that page from within the CMS? If so, you can try this method:

Go to Admin -> Section Editors and create a new section.
Under Advanced Menus, select "Text Link"
Click "Modify" for that section
Under "Open link in", select "inline iframe"
For "Link URL" enter the URL of the page you want.

That should do it. Please note that this will not password protect this page. If someone new the URL, they would still be able to view it. You'll need the website membership plugin in order to password protect it.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Create page on admin & hide record with same name

By jimmy.g - July 18, 2012

Hi,
So I can add any content I want by this way into the administration?
if yes this is amazing and I'll surely buy membership plugin it will allow me to do many interesting stuff with it.
THank you Jason.

All my question are answered so no need to reply :) thanks again
bye

Re: [Jason] Create page on admin & hide record with same name

I have membership plugin.

I've included viewer_functions.php in the iframe include file

I've added if (!$CURRENT_USER) { websiteLogin_redirectToLogin(); } to the iframe include file

When i access the include page from within CMSB, I'm required to log in again (the log in screen appears within the iframe) even though I'm already logged in.

What can i do to avoid this double log in?

Thank you

Re: [greg] Create page on admin & hide record with same name

Thanks for your quick reply

I'm using 2.17
Membership 1.07
Table "accounts" (default)
Separate Log in is set to false

The issue is as you suspect the iframe is not using the "main" page's (CMB'S) session rather its own.

I know this will work if it opens in a new page but I specifically wan this to work seamlessly within CMSB.

Any help would be greatly appreciated.

Regards,

PS. I actually was the one who commissioned CMSB to build this feature, it would be great if the "include pages" where actually php includes and not iframes.

Re: [brownleather] Create page on admin & hide record with same name

Hi,

I've had a more in-depth look at this problem and couldn't replicate it on my test site. Please could you fill in a second level support request so that I can look into this properly for you?

You'll need to fill out the form on this page:

https://www.interactivetools.com/support/email_support_form.php

Thanks
Greg Thomas







PHP Programmer - interactivetools.com