Page 1 of 1

Available WCMS Variables

Posted: Fri 5. Dec 2003, 22:00
by SouthMS
Great CMS:

Has anyone put together a list of phpwcms variables that can be used in a PHP script?

How are those variables used in the script??

For Example: Can I use a variable that holds the current cateogry name so that I can call a script with that category name?? (I want to query a database from my Guides>Accomodations page. But I want to pass Accomodations to the script ??

Thanks Oliver
Oliver your scripts are just what I have been looking for.
Steve
South Mississippi

Re: Available WCMS Variables

Posted: Fri 5. Dec 2003, 22:13
by frold
SouthMS wrote:Great CMS:

Has anyone put together a list of phpwcms variables that can be used in a PHP script?
Is it this you are looking for?

http://www.phpwcms.de/forum/viewtopic.p ... highlight=

Re: Available WCMS Variables

Posted: Sat 6. Dec 2003, 00:10
by SouthMS
frold wrote:
SouthMS wrote:Great CMS:

Has anyone put together a list of phpwcms variables that can be used in a PHP script?
Is it this you are looking for?

http://www.phpwcms.de/forum/viewtopic.p ... highlight=
Thanks for the response frold.

Those are the tags that can be used. I'm looking for ways to include variables from wcms in PHP scripts. For Example. IF the wcms variable for category is $category_id then I could use that variable in my script. I was looking for a list of the available variables.

I'm new to PHP and haven'tt had time to look at the scripts to see what the global variables are.

Thanks Again
Steve

Posted: Sat 6. Dec 2003, 13:22
by Oliver Georgi
Have a look into the content.func.inc.php and content.article.inc.php. The used vars are self explaining (most of them I hope). Test it by using simple php inludes <?php echo $var ?>

I have not prepared a list.

Oliver

Posted: Sat 6. Dec 2003, 16:51
by SouthMS
Thanks Oliver..

I started looking throught the index.php file and saw those includes.

I will look at those and pull out what I need.

Thanks
Steve

Posted: Sat 6. Dec 2003, 17:20
by frold
What did you need I´m curious :lol:

Posted: Mon 26. Jan 2004, 14:59
by SouthMS
Oliver Georgi wrote:Have a look into the content.func.inc.php and content.article.inc.php. The used vars are self explaining (most of them I hope). Test it by using simple php inludes <?php echo $var ?>

I have not prepared a list.

Oliver
Hey Oliver,

I have been away and havent had time to work on my project.
I tried coping <?php echo $var ?> into my default template with several variables but nothing appeared. (I'm very new to PHP BTW).
I want to add to my template the acat_name variable so that which ever category I'm in it will display the name.
Thanks

Posted: Mon 26. Jan 2004, 15:25
by Oliver Georgi
This really does not work.

It's not possible to add <?php mnnn ?> anywhere in your template. This will show <?php...?> inside of your doc.

Custom PHP code can only be included by using external files. This is the same as including a file in a function. That's why you have to use $GLOBALS to get phpwcms vars into your external script. But you have direct access to all $_SERVER, $_POST, $_GET... because these are always global vars.

How to get current cat name is described in forum anywhere ;-)

external php-file

Posted: Wed 18. Feb 2004, 14:30
by macangelo
if I write an external php-file to show a $var, does this externel php-file need any includes or database references to work?

Thanks a lot

Macangelo

Posted: Wed 18. Feb 2004, 14:35
by Oliver Georgi
No - as long as you do not want to include special sql queries or something else.

If you want to have access to own db stuff use $db as db resource. If you are unsure how to handle vars try to access them though $GLOBALS['myvar'] - because the file is included via a php function() {..}

Oliver

Posted: Wed 18. Feb 2004, 15:03
by macangelo
for example, I want to show the the "article title" and the "article subtitle"

Thanks

Macangelo