Forums | Mahara Community

Open Discussion /
how include php page


anonymous profile picture
Account deleted
Posts: 14

12 January 2011, 8:50

I want to add a php page to mahara include in the ...

But the reference is not successful

 

May I ask how to implement!!

anonymous profile picture
Account deleted
Posts: 19

21 July 2011, 1:51

Hi there,

I am trying to do same.I can't include any page in the middle content portion in mahara page and can not apply any dynamic php coding in the mahara file system like iframe and all.

If you have found any solution please reply.

Thanks and Regards..
Sid

anonymous profile picture
Account deleted
Posts: 14

21 July 2011, 2:40

Hello,

First you need to include any page to add...

<?php 
include('SQL_Config/conn_class.php'); 
include('SQL_Config/DB_Object.php'); 
define('INTERNAL', 1); 
define('PUBLIC', 1); 
define('MENUITEM', ''); 
define('HOME', 1); 
require('../init.php'); 
define('TITLE', get_string('home')); 

// Check for whether the user is logged in, before processing the page. After 
// this, we can guarantee whether the user is logged in or not for this page. 
if (!$USER->is_logged_in()) { 
    $pagename = 'loggedouthome'; 
    $lang = param_alphanumext('lang', null); 
    if (!empty($lang)) { 
        $SESSION->set('lang', $lang); 
        redirect(); 
    } 
} 
$smarty = smarty(); 
//$smarty->assign('page_content', get_site_page_content($pagename)); 

if ($nviews = get_config('homepageviewlist')) { 
    require_once('view.php'); 
    $views = View::view_search(null, null, null, null, $nviews, 0, true, 'mtime DESC'); 
    $smarty->assign('views', $views->data); 
} 
$smarty->display('xxxxx.tpl');  -->Definitions include any page of the template

$SESSION=$_SESSION; 

?> 

Kristina Hoeppner's profile picture
Posts: 4729

21 July 2011, 4:16

Hello Sid,

Any code that may be a security issue, e.g. iFrames, scripts etc. are not permitted to be included in text boxes, journal posts etc. iFrames for example can be allowed if you write a filter for that specific iFrame. Mahara core will not allow iFrames per se, but only based on exeptions. There are already iFrame filters available for YouTube, WikiEducator and a few other sites. Thus, if you take a look at the code, you may already get an idea of how to allow your specific iFrames.

It is not advisable to allow aiFrames in general or to allow any user to use php or other code in their pages.

Cheers

Kristina

anonymous profile picture
Account deleted
Posts: 14

21 July 2011, 7:45

Really sorry

Doing the wrong model

anonymous profile picture
Account deleted
Posts: 19

22 July 2011, 3:12

Hi judy,

I tried to apply your code and I was not successful for its implementation in the MAHARA site.
Can you explain in brief how did you manage it?

Thanks & Regards
Sid

anonymous profile picture
Account deleted
Posts: 19

22 July 2011, 3:15

Hi Kristina,

Thanks for your reply.

I read your answer and I will tack care of it in future while modifying MAHARA coding side work.

Thanks and Regards..
Sid

A post by Account deleted was deleted

8 results