User variable in CMS

Issues related to the CMS tools of WYSIWYG Web Builder.
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/cms_tools.html
A lot of information about the Content Manager System can be found in the help/manual. Please read this first before posting any questions! Also check out the demo template that is include with the software.

CMS trouble shooting / FAQ:
viewtopic.php?f=10&t=43245
User avatar
Pablo
 
Posts: 20167
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: User variable in CMS

Post by Pablo » Wed Jun 29, 2016 11:59 am

Example:

Code: Select all

<span id="LoginName1">Welcome <?php
if (isset($_SESSION['cms_user']))
{
   echo $_SESSION['cms_user'];
}
else
{
   echo 'Not logged in';
}
?>!</span>

User avatar
Hurtado
 
 
Posts: 722
Joined: Sun Nov 04, 2012 12:02 pm
Location: Valladolid
Contact:

Re: User variable in CMS

Post by Hurtado » Wed Jun 29, 2016 5:45 pm

Put that code into an HTML Object and don´t show anything
http://www.naturalschool.es/nueva/AdminCMS.php

User avatar
Pablo
 
Posts: 20167
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: User variable in CMS

Post by Pablo » Wed Jun 29, 2016 6:06 pm

You did not apply any styling to the code.

User avatar
Hurtado
 
 
Posts: 722
Joined: Sun Nov 04, 2012 12:02 pm
Location: Valladolid
Contact:

Re: User variable in CMS

Post by Hurtado » Wed Jun 29, 2016 7:28 pm

?

User avatar
Hurtado
 
 
Posts: 722
Joined: Sun Nov 04, 2012 12:02 pm
Location: Valladolid
Contact:

Re: User variable in CMS

Post by Hurtado » Wed Jun 29, 2016 7:40 pm

Assign a class.
Show message of no session started
Image

User avatar
Pablo
 
Posts: 20167
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: User variable in CMS

Post by Pablo » Wed Jun 29, 2016 8:07 pm

Please note that I was just giving you an example. You may need to fine tune the code.
I cannot assist you with custom coding.

User avatar
Hurtado
 
 
Posts: 722
Joined: Sun Nov 04, 2012 12:02 pm
Location: Valladolid
Contact:

Re: User variable in CMS

Post by Hurtado » Wed Jun 29, 2016 8:17 pm

Thanks
That code don´t work
Maybe in a future release you can provide an object for this?
That code don´t recognizes the session

User avatar
Hurtado
 
 
Posts: 722
Joined: Sun Nov 04, 2012 12:02 pm
Location: Valladolid
Contact:

Re: User variable in CMS

Post by Hurtado » Wed Jun 29, 2016 8:29 pm

Finnaly work

This is the correct code

Code: Select all

<span id="LoginName1" class="UserStyle">Usuario: <?php

session_start();

if (isset($_SESSION['cms_user']))
{
   echo $_SESSION['cms_user'];
}
else
{
   echo 'Debe iniciar sesion';
}

?>!</span>
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests