51
JamesSAEP
Re: Mx-Directory 3 RC1 Blank page under xoops 2.016
  • 2006/12/27 20:40

  • JamesSAEP

  • Just can't stay away

  • Posts: 732

  • Since: 2005/2/28


Was replacing the code below supposed to fix the php5 blank page issue? If so, I've tried it and no luck.

Thanks.

Quote:

tripmon wrote:
You can try replacing the index.php file with the code below:
Please post back & let me know if it resolves your issue.
<?php
// $Id: index.php,v 3.01 2006/12/15 16:11:06 tripmon Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <https://xoops.org/>                             //
// ------------------------------------------------------------------------- //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
//    Hacks provided by: Adam Frick                                             //
//     e-mail: africk69@yahoo.com                                                 //
//    Purpose: Create a yellow-page like business directory for XOOPS using      //
//    the mylinks module as the foundation.                                     //
// ------------------------------------------------------------------------- //
include_once "header.php";
include_once 
"class/coupon.php";
include_once 
XOOPS_ROOT_PATH."/class/xoopstree.php";

global 
$xoopsDB$xoopsModule$xoopsModuleConfig;

function 
add_header($tpl_source, &$xoopsTpl)
{
    return 
"<?php echo $xoops_module_header; ?>n".$tpl_source;
}

$xoopsOption['template_main'] = 'xdir_index.html';
$xoopsOption['xoops_module_header']= $xoops_module_header;
//cache start
include XOOPS_ROOT_PATH."/header.php";

$xoopsTpl->register_postfilter('add_header');
$xoopsTpl->assign('xoops_module_header'$xoops_module_header);

$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object

$mytree = new XoopsTree($xoopsDB->prefix("xdir_cat"),"cid","pid");

$result=$xoopsDB->query("SELECT cid, title, imgurl FROM ".$xoopsDB->prefix("xdir_cat")." WHERE pid = 0 ORDER BY title") or exit("Error");
//Alpha List
$letters letters();
$xoopsTpl->assign('letters'$letters);
//mid for admin
$xoopsTpl->assign('xmid'$xoopsModule->getVar('mid'));

//iterate from parent ID down
$count 1;
while(
$myrow $xoopsDB->fetchArray($result)) {
    
$imgurl '';
    if (
$myrow['imgurl'] && $myrow['imgurl'] != "http://"){
        
$imgurl $myts->htmlSpecialChars($myrow['imgurl']);
    }
    
$totallink getTotalItems($myrow['cid'], 1);

    
// get child category objects
    
$subcategories '';
    if (
$xoopsModuleConfig['showsubc'] == 1) {
      
$arr = array();
      
$arr $mytree->getFirstChild($myrow['cid'], "title");
      
$space 0;
      
$chcount 0;
      foreach(
$arr as $ele){
          
$chtitle $myts->htmlSpecialChars($ele['title']);
          if (
$chcount 5) {
              
$subcategories .= "...";
              break;
          }
          if (
$space>0) {
              
$subcategories .= ", ";
          }
          
$subcategories .= "<a href="".XOOPS_URL."/modules/" . $xoopsModule->getVar('dirname') . "/viewcat.php?cid=".$ele['cid']."">".$chtitle."</a>";
          
$space++;
          
$chcount++;
      }
  }
    
$xoopsTpl->append('categories', array('image' => $imgurl'id' => $myrow['cid'], 'title' => $myts->htmlSpecialChars($myrow['title']), 'subcategories' => $subcategories'totallink' => $totallink'count' => $count));
    
$count++;
}
//total count
list($numrows) = $xoopsDB->fetchRow($xoopsDB->query("select count(*) from ".$xoopsDB->prefix("xdir_links")." where status>0"));
$xoopsTpl->assign('lang_thereare'sprintf(_MD_THEREARE,$numrows));

$numcols $xoopsModuleConfig['numcols'];
$colwidth floor100 $numcols );
$xoopsTpl->assign('numcols'$numcols);
$xoopsTpl->assign('colwidth'$colwidth);

if (
$xoopsModuleConfig['useshots'] == 1) {
    
$xoopsTpl->assign('shotwidth'$xoopsModuleConfig['logo_maximgwidth']);
    
$xoopsTpl->assign('tablewidth'$xoopsModuleConfig['logo_maximgwidth'] + 10);
    
$xoopsTpl->assign('show_screenshot'true);
    
$xoopsTpl->assign('lang_noscreenshot'_MD_NOSHOTS);
}

if (
$xoopsUser && $xoopsUser->isAdmin($xoopsModule->mid())) {
    
$isadmin true;
} else {
    
$isadmin false;
}

$xoopsTpl->assign('lang_description'_MD_DESCRIPTIONC);
$xoopsTpl->assign('lang_lastupdate'_MD_LASTUPDATEC);
$xoopsTpl->assign('lang_hits'_MD_HITSC);
$xoopsTpl->assign('lang_rating'_MD_RATINGC);
$xoopsTpl->assign('lang_ratethissite'_MD_RATETHISSITE);
$xoopsTpl->assign('lang_reportbroken'_MD_REPORTBROKEN);
$xoopsTpl->assign('lang_tellafriend'_MD_TELLAFRIEND);
$xoopsTpl->assign('lang_modify'_MD_MODIFY);
$xoopsTpl->assign('lang_latestlistings' _MD_LATESTLIST);
$xoopsTpl->assign('lang_category' _MD_CATEGORYC);
$xoopsTpl->assign('lang_visit' _MD_VISIT);
$xoopsTpl->assign('lang_comments' _COMMENTS);
$xoopsTpl->assign('lang_attention'_MD_ATTENTION);
$xoopsTpl->assign('lang_phone'_MD_BUSPHONE);
$xoopsTpl->assign('lang_fax'_MD_BUSFAX);
$xoopsTpl->assign('lang_email'_MD_BUSEMAIL);
$xoopsTpl->assign('lang_url'_MD_SITEURL);
//search and alpha display from module preferences
$xoopsTpl->assign('usealpha'$xoopsModuleConfig['usealpha']);
$xoopsTpl->assign('usesearch'$xoopsModuleConfig['usesearch']);
//mid autodetect
$xoopsTpl->assign('xmid'$xoopsModule->getVar('mid'));
//Smarty directory autodetect
$smartydir $xoopsModule->getVar('dirname');
$xoopsTpl->assign('smartydir'$smartydir);

$result $xoopsDB->query("SELECT l.lid, l.cid, l.title, l.address, l.address2, l.city, l.state, l.zip, l.country, l.mfhrs, l.sathrs, l.sunhrs, l.phone, l.fax, l.mobile, l.home, l.tollfree, l.email, l.url, l.logourl, l.submitter, l.status, l.date, l.hits, l.rating, l.votes, l.comments, l.premium, t.description FROM ".$xoopsDB->prefix("xdir_links")." l, ".$xoopsDB->prefix("xdir_text")." t WHERE l.status>0 and l.lid=t.lid ORDER BY date DESC"$xoopsModuleConfig['newlinks'], 0);
while(list(
$lid$cid$ltitle$address$address2$city$state$zip$country$mfhrs$sathrs$sunhrs$phone$fax$mobile$home$tollfree$email$url$logourl$submitter$status$time$hits$rating$votes$comments$premium$description) = $xoopsDB->fetchRow($result)) {

//Nice arrays for smarty selects
//include_once "include/functions.php";
$mfhrs ampm($mfhrs);
$sathrs ampm($sathrs);
$sunhrs ampm($sunhrs);
 
$bizhrs = array('1' => _MD_BUSMFHRSSHORT.$mfhrs,'2' => _MD_BUSSATHRSSHORT.$sathrs,'3' => _MD_BUSSUNHRSSHORT.$sunhrs,);
$bnums = array($phone,$fax,$mobile,$home,$tollfree);
$biznums displaybiznums($bnums);

$is_owner = (!empty($xoopsUser) && ($xoopsUser->getvar('uid') == $submitter)) ? '1' null ;

$lvlopts getpremopts($premium);

    if (
$isadmin) {
        
$adminlink '<a href="'.XOOPS_URL.'/modules/' $xoopsModule->getVar('dirname') . '/admin/index.php?op=modLink&amp;lid='.$lid.'"><img src="'.XOOPS_URL.'/modules/' $xoopsModule->getVar('dirname') . '/images/editicon.gif" border="0" alt="'._MD_EDITTHISLINK.'" /></a>';
    } else {
        
$adminlink '';
    }
    if (
$votes == 1) {
        
$votestring _MD_ONEVOTE;
    } else {
        
$votestring sprintf(_MD_NUMVOTES,$votes);
    }
    
$path $mytree->getPathFromId($cid"title");
    
$path substr($path1);
    
$path str_replace("/"," - ",$path);
    
$new newlinkgraphic($time$status);
    
$pop popgraphic($hits);
//    $coupon_handler =& xoops_getmodulehandler('coupon', $mydirname);
    
$coupon_handler = new XdirectoryCouponHandler($GLOBALS['xoopsDB']);
    
$coupons $coupon_handler->getCountByLink($lid);

    
$ratingfl = (($rating/2) - floor(($rating/2)) < 0.5) ? intval(floor($rating/2)*10) : intval((floor($rating/2)+.5)*10) ;
    
$ratingfl str_pad($ratingfl2"0"STR_PAD_LEFT);
    
$rating "<img src='".XOOPS_URL."/modules/" $xoopsModule->getVar('dirname') . "/images/ratings/rate"$ratingfl .".gif' alt='"._MD_RATINGC.number_format($rating2)."'/> ";
    
    
$xoopsTpl->append('links', array('id' => $lid'cid' => $cid'url' => $url'rating' => $rating'lvlopts' => $lvlopts'title' => $myts->htmlSpecialChars($ltitle).$new.$pop'address' => $myts->htmlSpecialChars($address), 'address2' => $myts->htmlSpecialChars($address2), 'city' => $myts->htmlSpecialChars($city), 'state' => $myts->htmlSpecialChars($state), 'zip' => $myts->htmlSpecialChars($zip), 'country' => $myts->htmlSpecialChars($country), 'bizhrs' => $bizhrs'biznums' => $biznums'email' => $myts->htmlSpecialChars($email), 'category' => $path'logourl' => $myts->htmlSpecialChars($logourl), 'is_owner' => $is_owner'updated' => formatTimestamp($time,"m"), 'description' => $myts->displayTarea($description,0), 'adminlink' => $adminlink'hits' => $hits'votes' => $votestring'coupons' => $coupons'comments' => $comments'premium' => $premium'mail_subject' => rawurlencode(sprintf(_MD_INTRESTLINK,$xoopsConfig['sitename'])), 'mail_body' => rawurlencode(sprintf(_MD_INTLINKFOUND,$xoopsConfig['sitename']).':  '.XOOPS_URL.'/modules/' $xoopsModule->getVar('dirname') . '/singlelink.php?cid='.$cid.'&lid='.$lid)));

}
//Premium Admin Colors
$xoopsTpl->assign('p1color'$xoopsModuleConfig['premium_listing1col']);
$xoopsTpl->assign('p2color'$xoopsModuleConfig['premium_listing2col']);
$xoopsTpl->assign('p3color'$xoopsModuleConfig['premium_listing3col']);
$xoopsTpl->assign('p4color',$xoopsModuleConfig['premium_listing4col']);
$xoopsTpl->assign('p5color'$xoopsModuleConfig['premium_listing5col']);
include 
XOOPS_ROOT_PATH.'/footer.php';
?>



52
JamesSAEP
Re: clone article .99 module issue
  • 2006/12/27 20:37

  • JamesSAEP

  • Just can't stay away

  • Posts: 732

  • Since: 2005/2/28


Bump

Still haven't been able to solve this one.



53
JamesSAEP
IP Address in "new user" notification email
  • 2006/12/27 20:22

  • JamesSAEP

  • Just can't stay away

  • Posts: 732

  • Since: 2005/2/28


Does anyone know of a way to have a users IP address be added to the admin email notification that is sent out when a new user registers on a site?

Thanks.



54
JamesSAEP
Re: Where are the modules?
  • 2006/12/18 22:27

  • JamesSAEP

  • Just can't stay away

  • Posts: 732

  • Since: 2005/2/28


I'm not sure what modules you need, but I've put together the my most used ones.

View Here



55
JamesSAEP
Re: theme code help needed.
  • 2006/12/18 15:16

  • JamesSAEP

  • Just can't stay away

  • Posts: 732

  • Since: 2005/2/28


Nice to know - thanks!



56
JamesSAEP
Re: theme code help needed.
  • 2006/12/18 14:37

  • JamesSAEP

  • Just can't stay away

  • Posts: 732

  • Since: 2005/2/28


Thanks for the reply. I used option 2 and it works well. Can you explain whey having a link before the <form> would cause my problem?



57
JamesSAEP
theme code help needed.
  • 2006/12/17 22:25

  • JamesSAEP

  • Just can't stay away

  • Posts: 732

  • Since: 2005/2/28


Can someone look at my theme.html and tell me what is wrong. The problem is with the "login username/pwd" boxes. They are supposed to be on the same row as the "store" link. Once you login, the usermenu does line up correctly. Below is the code, and you can see it at www.4x4n.com:

<tr>
    <
td  class="subLinks">
        <
a href="<{$xoops_url}>/store">Store</a> | 
        <{if 
$xoops_isuser}>
            <
a href="<{$xoops_url}>/user.php">Profile</a> |
            <
a href="<{$xoops_url}>/edituser.php">Edit Profile</a> |
            <
a href="<{$xoops_url}>/notifications.php">Notifications</a> |
            <{
php}>
            GLOBAL 
$xoopsUser;
            
$pm_handler =& xoops_gethandler('privmessage');
            
$uid $xoopsUser->getVar('uid');
            
$criteria = new CriteriaCompo(new Criteria('read_msg'0));
            
$criteria->add(new Criteria('to_userid'$uid));
            
$msgcount $pm_handler->getCount($criteria);
            
$GLOBALS['xoopsTpl']->assign('msgcount'$msgcount);
            <{/
php}>
                <{if 
$msgcount 0}>
                <
class="highlight" href="<{$xoops_url}>/viewpmsg.php">Inbox (<span style="color:#ffff00; font-weight: bold;"><{$msgcount}></span>)</a> |
                <{else}>
                <
a href="<{$xoops_url}>/viewpmsg.php">Inbox</a> |
                <{/if}>
            <{if 
$xoops_isadmin}>
            <
a href="<{$xoops_url}>/admin.php">Administration</a> |
            <{/if}>
        <
a href="<{$xoops_url}>/user.php?op=logout">Logout</a>
        <{else}>
<
form action="<{$xoops_url}>/user.php" method="post">
    
Username
    
<input type="text" name="uname" size="12" value="<{$block.unamevalue}>" maxlength="25">
    
Password 
    
<input type="password" name="pass" size="12" maxlength="32">
    <!-- <
input type="checkbox" name="rememberme" value="On" class ="formButton" /><{$block.lang_rememberme}><br /> //-->
    
<input type="hidden" name="xoops_redirect" value="<{$xoops_requesturi}>">
    <
input type="hidden" name="op" value="login">
    <
input  id="UserFormBut" type="submit" value="ENTER">
    <{
$block.sslloginlink}><a href="<{$xoops_url}>/user.php#lost">Lost Password</a> |
    <
a href="<{$xoops_url}>/register.php">Become a Member</a>
</
form>        
        <{/if}> 
    </
td>
 </
tr>



58
JamesSAEP
Re: clone article .99 module issue
  • 2006/12/15 16:09

  • JamesSAEP

  • Just can't stay away

  • Posts: 732

  • Since: 2005/2/28


Quote:

blindman wrote:
JamesSAEP, in your case the error message may come because you search in all module tables, writer table inclusive. And that writer table is empty. I have added with phpmyadmin a writer for cloned module and the error SQL message is gone.


I had added an entry into the cloned writer table, but still have message.



59
JamesSAEP
clone article .99 module issue
  • 2006/12/14 15:47

  • JamesSAEP

  • Just can't stay away

  • Posts: 732

  • Since: 2005/2/28


Apache 2.2
MySQL/PHP 5
XOOPS 2.0.16
Article .99

I have cloned the Article module and installed it successfully. All the features seem to work ok, but when I go to view my XOOPS profile where it lists the latest posts in each section, I get the following error and the cloned section doesn't appear:
You have an error in your SQL syntaxCheck the manual that corresponds to your MySQL server version for the right syntax to use near ') AND ac.ac_publish > 0 AND a.uid=2 ORDER BY a.art_id DESC LIM

The debug info is (magazine is the cloned module):
WarningInvalid argument supplied for foreach() in file /modules/magazine/include/functions.parse.php(100) : eval()'d code line 56

Did I miss something?



60
JamesSAEP
Re: Registered Users and Admins can see webpage but...
  • 2006/12/8 21:11

  • JamesSAEP

  • Just can't stay away

  • Posts: 732

  • Since: 2005/2/28


Make sure you set the Anonymous group to module access in Admin -> Group -> Anonymous.

Also, in the news module, set Anonymous to view article/category.




TopTop
« 1 ... 3 4 5 (6) 7 8 9 ... 66 »



Login

Who's Online

203 user(s) are online (127 user(s) are browsing Support Forums)


Members: 0


Guests: 203


more...

Donat-O-Meter

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

Latest GitHub Commits