Log in
Elgg Technical Support

Elgg Technical Support

Get support from other Elgg users

Using php script in HTML page and right hand pane problem

I have an Elgg powered site at http://gardenerschat-shed.net using Betty Jones' modified Buddychat template

On the external pages (homepage) on that site I wish to use a php script that calls up random quotes. I already have this script working on our main site at http://aberaeronallotments.org"

However as the external pages on the Elgg powered site are apparently HTML a php script won't run because the page needs to run in has to be saved with the extension .php.

Has anyone got any ideas how I can achieve this?

Also as a "by the way". When I edit the external pages, the first text editor is for a

lefthand information pane

There's another editor below it that is for a righthand information pane hand. Regardeless of what is entered in the righthand information pane nothing appears on the site.

Can someone clarify why this is please? Or am I missing something elementary here?!

Many Thanks,



  • BigG 1610 days ago

    Does anyone actually read my posts?  There never appears to be any responses, or should I be posting somewhere ele?


  • DhrupDeScoop 1610 days ago

    Is anyone actually reading my reply to this ???? LOLZ ;-) doan be so pushy heh heh;;; after all it's sunday !! rest day.. Sure can mix php & html anytime ;-) shud work. ackshully there's already some kinda random quotes plugins thingy, maybe several.. floating around..

  • BigG 1610 days ago

    Thanks Dhrup - when you say you can mix php and HTML - I already know that, because a file with a php extension will display exactly the same in a browser as a HTML file, except it will execute php commands.

    What I REALLY need to know is how do I get this line of code

    <?php include("quotes.php"); ?>

    inserted into the 'external page' on the front page of my site? At present when I edit the page the php line disappears when I save it and the 'include' file obviously does not appear when the page is displayed. I assume it's because Elgg saves the 'external page' as a HTML file.

    How do I get it to save the file as a php extension file (so that it will execute php commands) and if I change the extension name how do I then get Elgg to display that file on the front page of my site, because I again assume it will be trying to load the original file with a html extension?

    Am I making sense? Hope I get a response - we're only 90mins away from Monday here in the UK and the 'day of rest' will be over! :-)



  • DhrupDeScoop 1610 days ago

    must be in a file named aaaaaa.php
    in order for php to be called to process the php script and as well pass-thru whatever html may exist embedded in file. ps: u got my attention b/c I 1st read yr profile. u r not a kid ;-) u might be having a "path" problem. i know the timezone u r in. some of my best elgg-friends also live there ;-)

  • BigG 1610 days ago

    Can't find any plugins when I search for 'quotes' or 'random quotes' in the plugin lists. So I guess I'm back to using my 'include quotes php' file idea for my external page. If only I could find a way of doing it!


  • DhrupDeScoop 1610 days ago

    Try "Prayers" - that similar OR try ask my smartie-girly-friend Goofers -- she online right now - she has something called "Scopes" for random text ;-)

  • BigG 1610 days ago

    Thanks Dhrup! Ha-Ha no I wouldn't consider myself a 'kid' either!!!!

    So what you're saying is I have to save the 'quotes.php' file as 'aaaaaa.php' in the root directory of my site? And then use <?php include("aaaaaa.php"); in the external page coding to call it up?

    Why the difference? the 'quotes.php' file is already saved in the root directory.


    PS you must have a good taste in friends - do they all cause you hassle on your day of rest?

  • DhrupDeScoop 1610 days ago

    quotes.php is fine... but need to look where u r calling the "include" from (i think that yr prob maybe...) if quotes.php not pulled in - read yr apache error log for include not found error..

  • BigG 1610 days ago

    So you recon the insertion of the <?php include("quotes.php"); ?> line should be OK to insert in the external page coding - just that the 'quotes.php' file should be in a directory other than the root? Why does this bit of coding disappear when I recheck the html coding of the external page then? I assumed it was because that page does not handle php.

    Also where does the 'external page' live in my Elgg directories? I assume that's where the includes file should also be saved.

    I don't have access to the Apache logs - they're on a server in Texas! I'm not running the site from my own localhost.


  • DhrupDeScoop 1610 days ago

    r u talking re : "externalpages" in elgg ?


  • BigG 1610 days ago

    The page I'm editing is 'External Pages' in the administration menu in Elgg and 'Front Page' tab selected in the editing page of external pages. (By the way I'm using a customised version of Betty Jones' Buddychat template - whether that sheds any light on matters I don't know). If you want to view things at a deeper level in Firebug or similar the site is at: http://gardenerschat-shed.net

    Just checked again now, and if I insert the <?php include("quotes.php"); ?> line in the 'Front Page' coding and save it - nothing happens when I view it in 'Home' i.e. the includes does not get called up and when I go back to editing the code in the page the line of coding is not there! ???

    It's almost as if there's a function in the programme that does not allow you to insert that line of coding. Does that make sense to you?

    Listen Dhrup, I've got to go now - need zzzzs for an early start in the morning. Can I pick this up with you tomorrow? Or send me a mail at the address in my profile.

    Thanks - Good Night - catch you tomorrow?


  • BigG 1609 days ago

    Looks like EVERYONE went for zzzzzs! (permanently)


  • DhrupDeScoop 1609 days ago

    i usually go for zzz's 3am every nite.. if you want to be helped quick.. be ready with detailed info so we can follow quickly and make quick smarty-a suggestion. so far.. u bin talking in some circles.. e.g. if you (ahh my fave..) posted that code of yours that duz not work - it may take someone else 10 secs to spot problem.

  • gone 1609 days ago

    Have you shut off your htmlawed?  This blocks some coding from being saved if wrote with in elgg

  • gone 1609 days ago

    Thank you Dhrup for the pass along, however I do not use the externalpages plugin.  I code my external pages by hand.

    Random quotes, scope, tips.  I recoded quotes with script and changed everything to tips.  Same idea different structure.  Available for download on goofbucket

  • BigG 1608 days ago

    Thanks everyone. Sorry I've been a bit slow coming back, but replies are a bit like waiting for London buses here you wait ages for one and then they all turn up together!

    It seems the 'external pages' are saved as html files so they are not php enabled consequently they don't respond to a php call up. I've done a work around for the time being by inserting a php snippet in the "mod/buddytalk/views/default/canvas/layouts" so that the random quotes appear at the top of the left hand pane above the Front Page in external pages. Not ideal but it does the job.

    Got another problem though - if you fancy a collective head scratch in this same post.

    In FF, Opera and Chrome when I go to "All site albums" the album covers stretch out beyond the width of the page. Any ideas how I can rectify this?



You must log in to post replies.