Available WCMS Variables

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
SouthMS
Posts: 9
Joined: Fri 5. Dec 2003, 20:45
Location: South Mississippi, USA

Available WCMS Variables

Post 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
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Re: Available WCMS Variables

Post 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=
http://www.studmed.dk Portal for doctors and medical students in Denmark
SouthMS
Posts: 9
Joined: Fri 5. Dec 2003, 20:45
Location: South Mississippi, USA

Re: Available WCMS Variables

Post 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
User avatar
Oliver Georgi
Site Admin
Posts: 9892
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post 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
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
SouthMS
Posts: 9
Joined: Fri 5. Dec 2003, 20:45
Location: South Mississippi, USA

Post 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
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

What did you need I´m curious :lol:
http://www.studmed.dk Portal for doctors and medical students in Denmark
SouthMS
Posts: 9
Joined: Fri 5. Dec 2003, 20:45
Location: South Mississippi, USA

Post 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
User avatar
Oliver Georgi
Site Admin
Posts: 9892
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post 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 ;-)
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
macangelo
Posts: 756
Joined: Sat 29. Nov 2003, 14:19
Location: Düsseldorf
Contact:

external php-file

Post 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
User avatar
Oliver Georgi
Site Admin
Posts: 9892
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post 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
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
macangelo
Posts: 756
Joined: Sat 29. Nov 2003, 14:19
Location: Düsseldorf
Contact:

Post by macangelo »

for example, I want to show the the "article title" and the "article subtitle"

Thanks

Macangelo
Post Reply