1
jeffgr
Ajax Profiles - Need Advice
  • 2007/9/22 16:28

  • jeffgr

  • Quite a regular

  • Posts: 263

  • Since: 2004/2/22


Hi everyone,

I have been working on my own version of an Ajax Profiles hack. I am part-way there, but have just come up with another issue. It is best illustrated if you look at the linked image below:

Screenshot

I basically cannot get the smarty codes in the system_userinfo.html template to display properly...it just shows the codes.

Each tab of the profile links to a separate page, in another folder on my site.

In the example in the screenshot, I cut-and-pasted the code from the system_userinfo.html template into one of these new page. I tried both a regular html page and also a .php page...neither of them worked.

Any ideas on how to get the page template on this new page to display properly?

BTW, I will release this hack when it is working!

Thanks,

jeffgr

2
jeffgr
Re: Ajax Profiles - Need Advice
  • 2007/9/22 19:28

  • jeffgr

  • Quite a regular

  • Posts: 263

  • Since: 2004/2/22


I think what I need to do is to create a copy of the index file for the module that I am referring to on each tab...and then link to that new index page.

For example, say on one of the tabs, I want to display the main page for the Yogurt image gallery.

If I just link to the index.php page, it does show this page in the tab, but it basically loads the entire site in the tab as well...which I don't want.

What do I need to strip away from this page, so that only the module contents, and not the side bars, header area, and footer area display as well?

here is the code for the index.php file for the Yogurt module:

Any ideas on what needs to be removed, so that it only displays the mod contents?

Thanks!



<?php

/**
* XOOPS header
*/
include_once("../../mainfile.php");
$xoopsOption['template_main'] = 'yogurt_index.html';
include_once("../../header.php");

/**
* Module classes
*/
include("class/yogurt_images.php");

/**
* Is a member looking ?
*/
if (!empty($xoopsUser)){


/**
* If no $_GET['uid'] then redirect to own
*/
if ( isset($_GET['uid']))
{
$uid = $_GET['uid'];
} else {

header("Location: ".XOOPS_URL."/modules/album/index.php?uid=".$xoopsUser->getVar('uid'));
}

/**
* Is the user the owner of the album ?
*/
$isOwner = ($xoopsUser->getVar('uid')==$_GET['uid'])?true:false;

/**
* If it is an anonym
*/
} else {
if ( isset($_GET['uid']))
{
$uid = $_GET['uid'];
} else {

header("Location: ".XOOPS_URL."/modules/album/index.php?uid=1");
$isOwner = false;
}
}

/**
* Filter for search pictures in database
*/
$criteria_uid = new criteria('uid_owner',$uid);

/**
* Creating a factory of pictures
*/
$album_factory = new Xoopsyogurt_imagesHandler($xoopsDB);




/**
* Fetch picturesfrom de factory
*/
$pictures_object_array = $album_factory->getObjects($criteria_uid);

/**
* How many pictures are on the user album
*/
$pictures_number = $album_factory->getCount($criteria_uid);

/**
* If there is no pictures in the album
*/
if ($pictures_number==0){
$nopicturesyet = _MD_YOGURT_NOTHINGYET;
$xoopsTpl->assign('lang_nopicyet',$nopicturesyet);
} else {

/**
* Lets populate an array with the dati from the pictures
*/
$i = 0;
foreach ($pictures_object_array as $picture){
$pictures_array[$i]['url'] = $picture->getVar("url","s");
$pictures_array[$i]['desc'] = $picture->getVar("title","s");
$pictures_array[$i]['cod_img'] = $picture->getVar("cod_img","s");
$xoopsTpl->assign('pics_array', $pictures_array);
$i++;
}
}

/**
* Show the form if it is the owner and he can still upload pictures
*/
if (!empty($xoopsUser)){
if ($isOwner && $xoopsModuleConfig['nb_pict']>$pictures_number){
$maxfilebytes = $xoopsModuleConfig['maxfilesize'];
$album_factory->renderFormSubmit($maxfilebytes,$xoopsTpl);
}
}

/**
* Let's get the user name of the owner of the album
*/
$owner = new XoopsUser();
$identifier = $owner->getUnameFromId($uid);

/**
* Adding to the module js and css of the lightbox and new ones
*/
$header_lightbox = '<script type="text/javascript" src="lightbox/js/prototype.js"></script>
<script type="text/javascript" src="lightbox/js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="lightbox/js/lightbox.js"></script>
<link rel="stylesheet" href="include/yogurt.css" type="text/css" media="screen" />
<link rel="stylesheet" href="lightbox/css/lightbox.css" type="text/css" media="screen" />';


/**
* Assigning smarty variables
*/
$xoopsTpl->assign('lang_albumtitle',sprintf(_MD_YOGURT_ALBUMTITLE,"<a href=".XOOPS_URL."/userinfo.php?uid=".$uid.">".$identifier."</a>"));
$xoopsTpl->assign('path_yogurt_uploads',$xoopsModuleConfig['link_path_upload']);
$xoopsTpl->assign('xoops_pagetitle', $xoopsModule->getVar("name"). " - ".$identifier."'s album");
$xoopsTpl->assign('nome_modulo', $xoopsModule->getVar('name'));
$xoopsTpl->assign('lang_max_nb_pict', sprintf(_MD_YOGURT_YOUCANHAVE,$xoopsModuleConfig['nb_pict']));
$xoopsTpl->assign('lang_delete',_MD_YOGURT_DELETE );
$xoopsTpl->assign('lang_editdesc',_MD_YOGURT_EDITDESC );
$xoopsTpl->assign('isOwner',$isOwner);
$xoopsTpl->assign('lang_nb_pict', sprintf(_MD_YOGURT_YOUHAVE,$pictures_number));
$xoopsTpl->assign('xoops_module_header', $header_lightbox);
$xoopsTpl->assign('campo_token',$GLOBALS['xoopsSecurity']->getTokenHTML());


/**
* Adding the comment system
*/
include XOOPS_ROOT_PATH.'/include/comment_view.php';

/**
* Closing the page
*/
include("../../footer.php");
?>

Login

Who's Online

232 user(s) are online (144 user(s) are browsing Support Forums)


Members: 0


Guests: 232


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits