I´ve just set it as first xoops´page.
I´ll take a look at xDirectory.
But for now I´d like to discover the smartpartner problem! Thank you!
CREATE TABLE `ccr091202_smartpartner_partner` (
`id` int(11) NOT NULL auto_increment,
`categoryid` int(11) NOT NULL default '11',
`weight` int(10) NOT NULL default '0',
`datesub` int(11) NOT NULL default '1259850053',
`hits` int(10) NOT NULL default '0',
`hits_page` int(10) NOT NULL default '0',
`url` varchar(150) default '',
`image` varchar(150) NOT NULL default '-1',
`image_url` varchar(255) NOT NULL default '',
`title` varchar(255) NOT NULL default '',
`summary` text NOT NULL default 'Pirassununga/SP',
`description` text NOT NULL default ' ',
`contact_name` varchar(255) NOT NULL default '',
`contact_email` varchar(255) NOT NULL default '',
`contact_phone` varchar(255) NOT NULL default '',
`adress` text NOT NULL,
`status` tinyint(1) NOT NULL default '2',
`email_priv` tinyint(1) NOT NULL default '0',
`phone_priv` tinyint(1) NOT NULL default '0',
`adress_priv` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `status` (`status`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='SmartPartner by marcan' AUTO_INCREMENT=10 ;
INSERT INTO `ccr091202_smartpartner_partner` (`id`, `categoryid`, `weight`, `datesub`, `hits`, `hits_page`, `url`, `image`, `image_url`, `title`, `summary`, `description`, `contact_name`, `contact_email`, `contact_phone`, `adress`, `status`, `email_priv`, `phone_priv`, `adress_priv`) VALUES
(10001, 11, 0, 1259850053, 0, 0, '', '-1', '', 'Pedro de Carvalho', 'Pirassununga/SP', ' ', '', '', '3561 9057', 'Rua João felício Filho, 710 - Jardim Redentor', 2, 0, 0, 0),
(10002, 11, 0, 1259850053, 0, 0, '', '-1', '', 'Márcia Montovani', 'Pirassununga/SP', ' ', '', '', '3561 1234', 'Rua Mascarenhas pedroso, 710 - Jardim Redentor', 2, 0, 0, 0),
(10003, 11, 0, 1259850053, 0, 0, '', '-1', '', 'Carmo castro', 'Pirassununga/SP', '', '', ' ', '3561 4321', 'Rua José Felício, 2710 - Jardim Rntor', 2, 0, 0, 0);
AND SO ON
<?php
/**
* $Id: index.php,v 1.27 2006/02/13 17:42:12 malanciault Exp $
* Module: SmartPartner
* Author: The SmartFactory <www.smartfactory.ca>
* Licence: GNU
*/
/**
*Ceci nous produira un tableau de forme:
*
*PartnersArray[] =
* PartnersArray[TopCat1][info] = (nom, description)
* PartnersArray[TopCat1][partners] = array de partner (via fct get_partners_array())
* PartnersArray[TopCat1][subcats][0][info] = (nom, description)
* PartnersArray[TopCat1][subcats][0][partners] = array de partner
* PartnersArray[TopCat1][subcats][0][subcats]....
* Ainsi de suite
*
*ex: PartnersArray[TopCat1][partners][0][nom] contiendra le nom du 1er partenaire de TopCat1
*
*/
/**
*Loop inside the array of all partners to match with current category
*
*param $categoryid - id of the current category
*return array of partners for the current category
*/
function get_partners_array($categoryid){
foreach ($every_partners_array as $partnerObj ){
if($partnerObj->categoryid() == $categoryid && ($view_category_id || (!$view_category_id && sizeof($partners) < $xoopsModuleConfig['percat_user']))){
$partner = $partnerObj->toArray('index');
$partners[] = $partner;
}
}
return $partners;
}
/**
*Loop inside the array of all categories to find subcats for current category
*recusrive function: for each subcat found, call to function getcontent to
*get partners and subcats within it
*
*param $categoryid - id of the current category
*return array of subcats for the current category
*/
function get_subcats($every_categories_array,$categoryid, $level){
//global $every_categories_array;
$subcatArray = array();
$level++;
foreach ($every_categories_array as $subcatObj) {
if($subcatObj->parentid() == $categoryid ){
$subcatArray[] = get_cat_content($every_categories_array,$subcatObj,$level);
}
}
return $subcatArray;
}
/**
*Retrieve content for the current category
*
*param $categoryid - id of the current category
*return array of content for the current category
*/
function get_cat_content($every_categories_array, $categoryObj,$level){
$category = array();
$decalage='';
for($i=0;$i<$level;$i++){
$decalage .= '--';
}
$decalage .= ' ';
$category['title'] = $decalage.''.$categoryObj->name();
$category['description'] = $categoryObj->description();
$category['link_view'] = $categoryObj->getCategoryUrl();
$category['partners'] = get_partners_array($categoryObj->categoryid());
$category['image_url'] = $categoryObj->getImageUrl(true);
$category['subcats'] = get_subcats($every_categories_array,$categoryObj->categoryid(),$level);
return $category;
}
include "header.php";
$xoopsOption['template_main'] = 'smartpartner_index.html';
include XOOPS_ROOT_PATH."/header.php";
include "footer.php";
// At which record shall we start
$start = isset($_GET['start']) ? intval($_GET['start']) : 0;
$view_category_id = isset($_GET['view_category_id']) ? intval($_GET['view_category_id']) : 0;
$partners_total = $smartpartner_partner_handler->getPartnerCount();
if($xoopsModuleConfig['index_sortby']== 'title' || $xoopsModuleConfig['index_sortby']== 'weight'){
$order = 'ASC';
}
else{
$order = 'DESC';
}
//Retreive all records from database
$every_categories_array = $smartpartner_category_handler->getCategories(0,0,-1,'weight', 'ASC', true);
$every_partners_array = $smartpartner_partner_handler->getPartnersForIndex(-1, _SPARTNER_STATUS_ACTIVE, $xoopsModuleConfig['index_sortby'], $order);
$partnersArray = array();
//display All categories and partners
if(!$view_category_id){
//get orphan first if preference says so
if($xoopsModuleConfig['orphan_first']){
$partnersArray['orphan']['partners']= get_partners_array(0);
}
//get all categories and content
foreach ( $every_categories_array as $categoryObj){
if ($categoryObj->parentid()==0){
$partnersArray[] = get_cat_content($every_categories_array, $categoryObj,0);
}
}
//get orphan last if preference says so
if(!$xoopsModuleConfig['orphan_first']){
$partnersArray['orphan']['partners']= get_partners_array(0);
}
$categoryPath = '';
}
//viewing a specific category
else{
$currentCategoryObj = $every_categories_array[$view_category_id];
$partnersArray[] = get_cat_content($every_categories_array, $currentCategoryObj, 0);
if (!$partnersArray[0]['partners'] && !$partnersArray[0]['subcats']) {
redirect_header(SMARTPARTNER_URL, 3, _MD_SPARTNER_CATEGORY_EMPTY);
}
// Retreiving the category path
$categoryPath = $currentCategoryObj->getCategoryPath();
}
//$partners_total_onpage = $count;.partners
$xoopsTpl->assign('partners', $partnersArray);
//end new code to implement categories
// Partners Navigation Bar
//$pagenav = new XoopsPageNav($partners_total_onpage, $xoopsModuleConfig['perpage_user'], $start, 'start', '');
//$xoopsTpl->assign('pagenav', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>');
$xoopsTpl->assign('view_deteils_cat', _MD_SPARTNER_DETAIL_CAT);
$xoopsTpl->assign('on_index_page', $view_category_id == 0);
$xoopsTpl->assign('sitename', $xoopsConfig['sitename']);
$xoopsTpl->assign("displayjoin" , $xoopsModuleConfig['allowsubmit'] && (is_object($xoopsUser) || $xoopsModuleConfig['anonpost']));
$xoopsTpl->assign("img_max_width" , $xoopsModuleConfig['img_max_width']);
$xoopsTpl->assign('module_home', '<a href="' . SMARTPARTNER_URL . '">' . $smartpartner_moduleName . '</a>');
$xoopsTpl->assign('categoryPath', $categoryPath);
$xoopsTpl->assign('lang_intro_text' , $myts->displayTarea($xoopsModuleConfig['welcomemsg']));
$xoopsTpl->assign('lang_partner', _MD_SPARTNER_PARTNER);
$xoopsTpl->assign('lang_desc', _MD_SPARTNER_DESCRIPTION);
$xoopsTpl->assign('lang_edit', _MD_SPARTNER_EDIT);
$xoopsTpl->assign('lang_delete', _MD_SPARTNER_DELETE);
$xoopsTpl->assign('lang_hits', _MD_SPARTNER_HITS);
$xoopsTpl->assign('lang_join' , _MD_SPARTNER_JOIN);
$xoopsTpl->assign('lang_no_partners', _MD_SPARTNER_NOPART);
$xoopsTpl->assign('lang_main_partner', _MD_SPARTNER_PARTNERS);
$xoopsTpl->assign('lang_readmore', _MD_SPARTNER_READMORE);
if(!$xoopsModuleConfig['hide_module_name']){
$xoopsTpl->assign('lang_partnerstitle', $myts->displayTarea($xoopsModule->getVar('name')));
}
include_once XOOPS_ROOT_PATH.'/footer.php';
?>
<{php}>
$foto_temp = $this->get_template_vars('picture_url');
$ext = end(explode(".", $foto_temp));
if ($ext == "mp3" or $ext == "MP3" or $ext == "wma" or $ext == "WMA" or $ext == "au" or $ext == "AU" ) { echo "<div width="100%" align="center"><OBJECT id="MediaPlayer1" width="400" height="70" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"><param name="fileName" value=""<{/php}><{$picture_url}>"<{php}> echo "><param name="animationatStart" value="false"><param name="transparentatStart" value="true"><param name="autoStart" value="false"><param name="showControls" value="true"><PARAM NAME="ShowPositionControls" VALUE="true"> <PARAM NAME="ShowAudioControls" VALUE="true"><PARAM NAME=ShowDisplay" VALUE="false"><PARAM NAME="EnableTracker" VALUE="true"><PARAM NAME="ShowTracker" VALUE="true"><PARAM NAME="ShowStatusBar" VALUE="true"><param name="loop" value="true"><embed type="application/x-mplayer2" pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" id="MediaPlayer1" displaysize="4" autosize="-1" bgcolor="darkblue" showcontrols="true" showtracker="1" showdisplay="0" showstatusbar="1" videoborder3d="-1" width="400" height="70" src=""<{/php}><{$picture_url}>"<{php}> echo " autostart="false" designtimesp="5311" loop="true"></embed></OBJECT></div> ";} else { echo"";}
if ($ext == "wmv" or $ext == "WMV" or $ext == "avi" or $ext == "AVI" ) { echo "<div width="100%" align="center"> <OBJECT id="MediaPlayer1" width="436" height="343" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"><param name="fileName" value=""<{/php}><{$picture_url}>"<{php}> echo "><param name="animationatStart" value="false"><param name="transparentatStart" value="true"><param name="autoStart" value="false"><param name="showControls" value="true"><PARAM NAME="ShowPositionControls" VALUE="true"> <PARAM NAME="ShowAudioControls" VALUE="true"><PARAM NAME=ShowDisplay" VALUE="false"><PARAM NAME="EnableTracker" VALUE="true"><PARAM NAME="ShowTracker" VALUE="true"><PARAM NAME="ShowStatusBar" VALUE="true"><param name="loop" value="true"></OBJECT> <embed type="application/x-mplayer2" pluginspage="http://microsoft.com/windows/mediaplayer/en/download" id="MediaPlayer1" displaysize="4" autosize="-1" bgcolor="darkblue" showcontrols="true" showtracker="1" showdisplay="0" showstatusbar="1" videoborder3d="-1" width="436" height="343" src=""<{/php}><{$picture_url}>"<{php}> echo " autostart="false" designtimesp="5311" loop="true"></embed><br /></div> ";} else { echo"";}
if ($ext == "flv" or $ext == "FLV" or $ext == "swf" or $ext == "SWF" ) { echo"<div width="100%" align="center"><table width="400" align="center" border="0" height="335"><tbody><tr><td align="center" bgcolor="#000000"><div id="container"><embed type="application/x-shockwave-flash" src="mediaplayer.swf" style="" id="mediaplayer" name="mediaplayer" quality="high" allowfullscreen="true" flashvars="width=436&height=343&file=";<{/php}><{$picture_url}>"<{php}> echo " width="436" height="343"></div></td></tr></tbody></table></div>";} else { echo"";} <{/php}>
<{php}> $foto_temp = <{$picture_url}>; echo $foto_temp ; <{/php}>
<{php}> $foto_temp = ".<{$picture_url}>."; echo $foto_temp ; <{/php}>
<{php}> $foto_temp = $picture_url; echo $foto_temp ; <{/php}>
<{php}> $foto_temp = albums/userpics/10001/Sussurros.wmv
; echo $foto_temp ; <{/php}>
$sform->addElement(new XoopsFormFile(_AM_SELFILE, 'attachedfile', $xoopsModuleConfig['maxuploadsize']), false);
/* $module_handler =& xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('hassearch', 1)); $criteria->add(new Criteria('isactive', 1)); $mids =& array_keys($module_handler->getList($criteria)); foreach ($mids as $mid) { if ( $gperm_handler->checkRight('module_read', $mid, $groups)) { $module =& $module_handler->get($mid); $results =& $module->search('', '', 5, 0, $thisUser->getVar('uid')); $count = count($results); if (is_array($results) && $count > 0) { for ($i = 0; $i < $count; $i++) { if (isset($results[$i]['image']) && $results[$i]['image'] != '') { $results[$i]['image'] = 'modules/'.$module->getVar('dirname').'/'.$results[$i]['image']; } else { $results[$i]['image'] = 'images/icons/posticon2.gif'; } if (!preg_match("/^http[s]*:///i", $results[$i]['link'])) { $results[$i]['link'] = "modules/".$module->getVar('dirname')."/".$results[$i]['link']; } $results[$i]['title'] = $myts->makeTboxData4Show($results[$i]['title']); $results[$i]['time'] = $results[$i]['time'] ? formatTimestamp($results[$i]['time']) : ''; } if ($count == 5) { $showall_link = '<a href="search.php?action=showallbyuser&mid='.$mid.'&uid='.$thisUser->getVar('uid').'">'._US_SHOWALL.'</a>'; } else { $showall_link = ''; } $xoopsTpl->append('modules', array('name' => $module->getVar('name'), 'results' => $results, 'showall_link' => $showall_link)); } unset($module); } }*/