Page 1 of 1

more complex php script inside the pages

Posted: Wed Feb 08, 2006 4:05 pm
by bkiss
Hi everyone,

I understand the simple php code it is possible to insert like user defined tag.
But i have a huge problem inserting a littlebit bigger and complex php code like connecting to a database (other than we use for cmsmadesimple), and fill with data , i will give a fragment from the code:


      choose the model
         
           
            ">
            0) {
      mysql_data_seek($Recordset1, 0);
  $row_Recordset1 = mysql_fetch_assoc($Recordset1);
  }
?>
         
   

You see it's full with small php codes ...
OK, I am a beginner, right, it's true.  :)

Pls help me !

Thank you,

Kiss Barni

Re: more complex php script inside the pages

Posted: Thu Feb 09, 2006 6:15 am
by kermit
Patricia wrote: Hi,
the user defined tag are actually alread enclosed into
so if your code begins and ends out of php, maybe you can do that

Code: Select all

?>
your code html and <?php somephpcode ?>
more html
<?php
I'm not sure, you must try.
Cheers
i tried something like that last week and the tag editor grumbled at me. 0.11.2 and 0.12.beta/svn seem to be a little different in what they accept, but there is definately some checking going on. i was able to get 2 blocks of php in one tag once, but i have no idea how i managed it (i can't go back into it, copy/paste the exact thing on top of itself and resave without getting the invalid code entered message).


bkiss: perhaps just reference an external file from within the tag?

Re: more complex php script inside the pages

Posted: Thu Feb 09, 2006 11:27 am
by bkiss
Actually i tryed to read from an external file and it works , but i don't see anymore the template...

I just thinking what if i try with html frames... anybody has experience with this?

Barni

Re: more complex php script inside the pages

Posted: Thu Feb 09, 2006 4:00 pm
by bkiss
I don't like frames too, i know the negative effect on search engines, but it will be no problem if 10% of the page will be with frames...
I will spend anyway some time to make corrections in the code inserted as user defined tag, maybe it will work... all this, in this weekend :)

Thank you anyway for your prompt replies.

Barni

Re: more complex php script inside the pages

Posted: Sat Feb 11, 2006 9:03 am
by bkiss
It's really funny, but in about 20 minutes i was finished, with a little code cosmetics.
It's working now... even its' full with .

Thank's for your help.

Barni

Re: more complex php script inside the pages

Posted: Sat Feb 11, 2006 11:19 am
by kermit
you could just follow the format of the stock tags in siteroot/plugins as well (which are coded as an 'entire' script). then just plop yours into that directory (instead of using 'user defined tag') and it's showtime.