Add php to global content block?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
cyberpaws
Forum Members
Forum Members
Posts: 16
Joined: Sat Aug 25, 2007 7:18 pm

Add php to global content block?

Post by cyberpaws »

Hello,

I was hoping to use the Image Block from Gallery2 in my sidebar.  I have this code:

Code: Select all


<?php @readfile('http://mywebsitehere.com/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title'); ?>


 
and was hoping to pop it into a Global Content Block and just drop it in my template, but that doesn't seem to be working. 

I searched the forums pretty completely but am unable to find an answer.  I'd appreciate any guidance.

I'm running CMS Made Simple 1.2.2 "Holetown"

thank you!
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Add php to global content block?

Post by Dr.CSS »

I believe GCBs don't need <?php in them...


EDIT: whoooops...
Last edited by Anonymous on Thu Jan 03, 2008 2:48 am, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Add php to global content block?

Post by calguy1000 »

GCB's are for html code,  use UDT's for php code.  You can call a udt from a gcb I believe.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
10010110

Re: Add php to global content block?

Post by 10010110 »

Yes, create a user defined tag and drop the PHP in there (without ), and then you can put that tag wherever you want: In regular content (page), into templates, into global content blocks… whatever you want.
cyberpaws
Forum Members
Forum Members
Posts: 16
Joined: Sat Aug 25, 2007 7:18 pm

Re: Add php to global content block?

Post by cyberpaws »

Thank you! 

Now I get to go create my very first UDT.. hopefully I'll figure it out!
Post Reply

Return to “CMSMS Core”