Page 2 of 12 FirstFirst 1234 ... LastLast
Results 11 to 20 of 114
  1. #11
    Join Date
    Feb 2005
    Posts
    246
    Plugin Contributions
    0

    Default Re: PHP inside ezpages

    Quote Originally Posted by rambo View Post
    I notice I can't input php with the default wysiwyg editor. It erases it and replaces it with a line break.

    I'm wanting to replace ezpages with my own uploaded php pages to be wrapped by the site. Is there an easier way to do this than to have an include in the ezpage?
    Before I discovered the eval() function, we used inline frames to present our PHP pages in the old infopages module. Passing variables can get tricky, but it works.

  2. #12
    Join Date
    Jul 2006
    Posts
    32
    Plugin Contributions
    0

    Default Re: PHP inside ezpages

    I'm good to use the eval function method. I just need to know how I can place php code into a page via a wysiwyg editor in ezpages. Like I said, the default embeded wysiwig is erasing my code. How are you guys doing this?

  3. #13
    Join Date
    Apr 2006
    Location
    Göteborg
    Posts
    126
    Plugin Contributions
    0

    Default Re: PHP inside ezpages

    Code:
    $titlecheck=substr($var_pageDetails->fields[pages_title],0,9);
    if ($titlecheck=="allowcode"){
    eval(stripslashes($var_pageDetails->fields['pages_html_text']));}
    else{echo $var_pageDetails->fields['pages_html_text']; }
    Change "allocode" to whatever name you want your php code ezpages to have, or add more names or remove the if alltogether if you want. (dont forget to change ,0,9 to ,0,x where x is the length of your "allowcode" replacement string.
    This way of using php in EZ-pages works in 1.3.6, but if used as an EZ-link and the "allowcode" check is used, how do you avoid the actual link to include "allowcode"?

    Or do you grab the EZ-page content directly from the database into another page (such as an info page) somehow? If so - how?

    My use is to store, say, seasonal texts (spring, summer, winter etc) as EZ-pages or define pages, and then in another EZ-page, or the main page, or in a category text reference the predefined seasonal EZ-page/define page -> an easy way to shift "templates" stored as EZ-pages. I see a huge potential for using ez-pages as "includes" on other pages (such as the main page, category descriptions, in the blank_sidebox) etc.
    Last edited by Wils; 19 Nov 2006 at 10:32 PM. Reason: Clarification

  4. #14
    Join Date
    May 2005
    Location
    Toronto, Ontario, Canada
    Posts
    42
    Plugin Contributions
    0

    Default Re: PHP inside ezpages

    This may be a solution for those using built-in WYSIWYG editors to edit PHP code. Unforutunately, both HTMLArea and TinyMCE WILL remove or damage PHP code.

    The good new is that FCKEditor "knows" about PHP and leaves it alone. You can grab it from Zen Cart downloads section here: http://www.zen-cart.com/index.php?ma...roducts_id=268. It should work "right out of the box". If, however, you get an updated version from http://www.fckeditor.net/, you'll need to edit a configuration file - specifically add or uncomment one line in fckconfig.js

    Code:
    FCKConfig.ProtectedSource.Add( /<\?[\s\S]*?\?>/g ) ;
    The version from the downloads section already has this line uncommented, so you don't need to do it.

    Note: you'll only see the PHP code in "Source" mode, it will not be visible in normal mode.

    Feedback is welcome!

    Dan G.

    Notebook Solutions Inc.

    http://www.notebooksolutions.ca

  5. #15
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: PHP inside ezpages

    I can see it is coded to do this ... but I am having a user moment here ... and not getting it to actually execute the php code ... so what's the trick?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #16
    Join Date
    Feb 2006
    Posts
    130
    Plugin Contributions
    0

    Default Re: PHP inside ezpages

    I am using ZC 1.3.7

    I have tried both methods described in this thread and can not get it to output PHP code.

    I am trying to troubleshoot my problem. Does this method work in ZC 1.3.7 ?

    Thanks for your support,

    Pic

  7. #17
    Join Date
    Feb 2006
    Posts
    130
    Plugin Contributions
    0

    Default Re: PHP inside ezpages

    Sorry, I had bad PHP in my test, ignore previous post asking for troubleshooting help.

    The both methods work fine in ZC 1.3.7

    What are the security issues when using this code?

    Thanks for your support,

    Pic

  8. #18

    Default Re: PHP inside ezpages

    Hello All,

    I didn't have any problem putting the .php code into my ezpage but i do have a problem with the page opening sub-pages.

    What i'm trying to do is use a PHP link manager code to manage links. The code works great until you click on a catagory to see the links inside that catagory. I'm thinking it has something to do with dynamic link page numbers since the linked page info is looking for /resources.php?cid=1831 and Zen uses /index.php?main_page=page&id=3&chapter=1

    is there anyway to get around that other than installing USEO? which looks great, but seems to have some problems from all the messages and issues i've read.

    You can take a look for yourself at:
    http://smilesdiscounts.com/index.php...id=3&chapter=1

    Thanks in advance!

    Cornell

  9. #19
    Join Date
    Feb 2005
    Posts
    246
    Plugin Contributions
    0

    Default Re: PHP inside ezpages

    Use the simplified version given by brandtim 20th June 2006, 07:04 PM.
    Code:
    <?php eval(stripslashes('?>' . $var_pageDetails->fields['pages_html_text'])); ?>
    It's simply better. If for some reason, that just won't work for you, choose a word that is keyword rich in place of "allowcode". Just remember to replace the "9" in "],0,9)" with the length of your keyword. Then it won't (or shouldn't) matter if it shows up in the link.

    You could also do multiple title checks, but that requires a hard edit for every page where you want to allow the code. Take out the substring part, and test the full string
    Code:
    if ($titlecheck=="allowcode" || $titlecheck=="Some Page Title" || $titlecheck=="Another Page"){...

    Quote Originally Posted by Wils View Post
    Code:
    $titlecheck=substr($var_pageDetails->fields[pages_title],0,9);
    if ($titlecheck=="allowcode"){
    eval(stripslashes($var_pageDetails->fields['pages_html_text']));}
    else{echo $var_pageDetails->fields['pages_html_text']; }
    This way of using php in EZ-pages works in 1.3.6, but if used as an EZ-link and the "allowcode" check is used, how do you avoid the actual link to include "allowcode"?

  10. #20

    Default Re: PHP inside ezpages

    OK, I am a bit slow and I don't understand how EZPages are generated. I have this code that I want to put on http://www.giftsbearsetc.com/store/i...id=1&chapter=0
    via EZPages.

    <?php
    /*<--- BEGIN MY LINK HELPER CODE --->

    Making modifications to this code can cause your links page to stop working. Please only make
    modifications where modifications are allowed. Being that this is a free service, we do not have
    the resources to help you debug any changes you may have made. If you do run into problems with
    this code, log into your account and download the original again.

    */
    $OnCat = @$_GET["cid"];

    if ($OnCat == "") {$OnCat = "0";} //Set to Main Directory Page

    //You may name your links page anything you want. But for your links page to work correctly
    //you must provide us with the name of your links page (without the '.php' extension).
    $PageName = "resources"; // change this value to match your [PageName].php links page

    //You may modify the following variable to change how many columns your main directory displays.
    //By default this value is set to show 2 columns, but you may show as few as 1 column or
    //as many as 4. Valid values (1,2,3,4)
    $DirectoryCols = 2; // change this value to adjust how many columns your main directory page displays

    //You may modify the following variable to change how many columns your sub category directory pages display.
    //By default this value is set to show 2 columns, but you may show as few as 1 column or
    //as many as 4. Valid values (1,2,3,4)
    $SubCategoryCols = 2; // change this value to adjust how many columns your sub category pages display

    //You may modify the following variable to display your links on a single page instead of
    //directory style. This is a convenient way to display your links if you have fewer than 40.
    $ShowAsSinglePage = 0; // change this value to 1 if you want a single page, or 0 for directory

    $file = file("http://www.mylinkhelper.com/bin/phpdynfetch.asp?id=E65D16FF-A31E-4886-B052-9F52754E9A93&pagename=".$PageName."&cid=".$OnCat."&dircols=".$DirectoryCols."&su bcols=".$SubCategoryCols."&single=".$ShowAsSinglePage);

    if ($OnCat == "0") {
    //This value is the title for your main directory page and can be modified
    $sTitle = "Gifts Bears Etc.";
    $GetLinks = $file[0];
    } else {
    $iPos = strpos($file[0], "|");
    $sTitle = substr($file[0],0,$iPos);
    $GetLinks = substr($file[0],$iPos + 1,strlen($file[0]));
    }
    //<--- END MY LINK HELPER CODE --->
    ?>
    <!--
    Place the following code into the location of your webpage template that you want your
    directory to be displayed, it will assume the link syles and sizes you have defined
    in your stylesheet.

    Also, don't forget to use the "sTitle" variable to customize the page!

    Please delete this comment when you implement your links directory.
    -->
    <title><?=$sTitle;?></title>
    <?=$GetLinks;?>


    This will display a links page. What do I do? I need specific instructions or I will fail for sure! Thanks...

 

 
Page 2 of 12 FirstFirst 1234 ... LastLast

Similar Threads

  1. PHP inside EZ-Pages
    By digiprint in forum General Questions
    Replies: 0
    Last Post: 17 Jun 2013, 09:10 AM
  2. PHP code inside of an EZ page
    By tcarden in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 18 Dec 2012, 05:19 PM
  3. PHP inside EZpages
    By hookah in forum General Questions
    Replies: 3
    Last Post: 15 Nov 2008, 08:40 AM
  4. search inside php files
    By papadopoulos in forum General Questions
    Replies: 2
    Last Post: 20 Jun 2006, 02:31 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR