1
isaacbg
Xdirectory problem
  • 2004/1/10 12:43

  • isaacbg

  • Just popping in

  • Posts: 4

  • Since: 2003/9/9 2


Hi:

I use XOOPS 2.502 and I've just installed Xdirectory, it's great but when someone submit a business and I go to the submited section there is no option to approve the submitted information, it just appear the information submitted by my users but I can't approve it, there is no button to approve the information.

Someone knows about it?

Thanks for your time

2
builderb
Re: Xdirectory problem
  • 2004/1/10 17:06

  • builderb

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/8/4 2


can you post the code from /admin/index.php between the following lines:
@ line#86 function listNewLinks()
to
@ line#190 xoops_cp_footer();

This is the section that deals with approving new links.

-Builderb

3
isaacbg
Re: Xdirectory problem
  • 2004/1/10 17:25

  • isaacbg

  • Just popping in

  • Posts: 4

  • Since: 2003/9/9 2


First of all thanks for your interest:

I copy the code:
Quote:

function listNewLinks()
{
global $xoopsDB, $xoopsConfig, $myts, $eh, $mytree;
// List links waiting for validation
$linkimg_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/modules/xdirectory/images/shots/");
$result = $xoopsDB->query("select lid, cid, title, address, address2, city, state, zip, country, phone, fax, email, url, logourl, submitter, premium from ".$xoopsDB->prefix("xdir_links")." where status=0 order by date DESC");
$numrows = $xoopsDB->getRowsNum($result);
xoops_cp_header();
echo "<h4>"._MD_WEBLINKSCONF."</h4>";
echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
."<tr class=\"odd\"><td>";
echo "<h4>"._MD_LINKSWAITING." ($numrows)</h4><br />";
if ( $numrows > 0 ) {
while(list($lid, $cid, $title, $address, $address2, $city, $state, $zip, $country, $phone, $fax, $email, $url, $logourl, $submitterid, $premium) = $xoopsDB->fetchRow($result)) {
$result2 = $xoopsDB->query("select description from ".$xoopsDB->prefix("xdir_text")." where lid=$lid");
list($description) = $xoopsDB->fetchRow($result2);
$title = $myts->makeTboxData4Edit($title);
$address = $myts->makeTboxData4Edit($address);
$address2 = $myts->makeTboxData4Edit($address2);
$city = $myts->makeTboxData4Edit($city);
$state = $myts->makeTboxData4Edit($state);
$zip = $myts->makeTboxData4Edit($zip);
$country = $myts->makeTboxData4Edit($country);
$phone = $myts->makeTboxData4Edit($phone);
$fax = $myts->makeTboxData4Edit($fax);
$email = $myts->makeTboxData4Edit($email);
$url = $myts->makeTboxData4Edit($url);
// $url = urldecode($url);
$logourl = $myts->makeTboxData4Edit($logourl);
// $logourl = urldecode($logourl);
$description = $myts->makeTareaData4Edit($description);
$submitter = XoopsUser::getUnameFromId($submitterid);
echo "<form action=\"index.php\" method=post>\n";
echo "<table width=\"80%\">";
echo "<tr><td align=\"right\" nowrap>"._MD_SUBMITTER."</td><td>\n";
echo "<a href=\"".XOOPS_URL."/userinfo.php?uid=".$submitterid."\">$submitter</a>";
echo "</td></tr>\n";
echo "<tr><td align=\"right\" nowrap>"._MD_SITETITLE."</td><td>";
echo "<input type=\"text\" name=\"title\" size=\"50\" maxlength=\"100\" value=\"$title\">";
echo "</td></tr><tr><td align=\"right\" nowrap>"._MD_BUSADDRESS."</td><td>";
echo "<input type=\"text\" name=\"address\" size=\"50\" maxlength=\"250\" value=\"$address\">";
echo "</td></tr><tr><td align=\"right\" nowrap>"._MD_BUSADDRESS2."</td><td>";
echo "<input type=\"text\" name=\"address2\" size=\"50\" maxlength=\"250\" value=\"$address2\">";
echo "</td></tr><tr><td align=\"right\" nowrap>"._MD_BUSCITY."</td><td>";
echo "<input type=\"text\" name=\"city\" size=\"50\" maxlength=\"250\" value=\"$city\">";
echo "</td></tr><tr><td align=\"right\" nowrap>"._MD_BUSSTATE."</td><td>";
echo "<input type=\"text\" name=\"state\" size=\"50\" maxlength=\"250\" value=\"$state\">";
echo "</td></tr><tr><td align=\"right\" nowrap>"._MD_BUSZIP."</td><td>";
echo "<input type=\"text\" name=\"zip\" size=\"50\" maxlength=\"250\" value=\"$zip\">";
echo "</td></tr><tr><td align=\"right\" nowrap>"._MD_BUSCOUNTRY."</td><td>";
echo "<input type=\"text\" name=\"country\" size=\"50\" maxlength=\"250\" value=\"$country\">";
echo "</td></tr><tr><td align=\"right\" nowrap>"._MD_BUSPHONE."</td><td>";
echo "<input type=\"text\" name=\"phone\" size=\"50\" maxlength=\"250\" value=\"$phone\">";
echo "</td></tr><tr><td align=\"right\" nowrap>"._MD_BUSFAX."</td><td>";
echo "<input type=\"text\" name=\"fax\" size=\"50\" maxlength=\"250\" value=\"$fax\">";
echo "</td></tr><tr><td align=\"right\" nowrap>"._MD_BUSEMAIL."</td><td>";
echo "<input type=\"text\" name=\"email\" size=\"50\" maxlength=\"250\" value=\"$email\">";
echo "</td></tr><tr><td align=\"right\" nowrap>"._MD_SITEURL."</td><td>";
echo "<input type=\"text\" name=\"url\" size=\"50\" maxlength=\"250\" value=\"$url\">";
echo " [ <a href=\"$url\" target=\"_blank\">"._MD_VISIT."</a> ]";
echo "</td></tr>";
echo "<tr><td align=\"right\" nowrap>"._MD_CATEGORYC."</td><td>";
$mytree->makeMySelBox("title", "title", $cid);
echo "</td></tr>\n";
echo "<tr><td align=\"right\" valign=\"top\" nowrap>"._MD_DESCRIPTIONC."</td><td>\n";
echo "<textarea name=description cols=\"60\" rows=\"5\">$description</text>\n";
echo "</td></tr>\n";
echo "<tr><td align=\"right\" nowrap>"._MD_SHOTIMAGE."</td><td>\n";
echo "<input type=\"text\" name=\"logourl\" size=\"50\" maxlength=\"60\">\n";
echo "<select size='1' name='logourl'>";
echo "<option value=' '>------</option>";
foreach($linkimg_array as $image){
echo "<option value='".$image."'>".$image."</option>";
}
echo "</select>";
echo "</td></tr>\n";
echo "<tr><td align=\"right\" nowrap>"._MD_PREMIUM."</td><td>\n";
echo "<select size='1' name='premium'>";
echo "<option value=''>------</option>";
echo "<option value='1'>Show URL</option>";
echo "</select>";
echo "</td></tr><tr><td></td><td>";
$shotdir = "<b>".XOOPS_URL."/modules/xdirectory/images/shots/</b>";
printf(_MD_SHOTMUST,$shotdir);
echo "</td></tr>\n";
echo "</table>\n";
echo "<br /><input type=\"hidden\" name=\"op\" value=\"approve\"></input>";
echo "<input type=\"hidden\" name=\"lid\" value=\"$lid\"></input>";
echo "<input type=\"submit\" value=\""._MD_APPROVE."\"></form>\n";
echo myTextForm("index.php?op=delNewLink&lid=$lid",_MD_DELETE);
echo "<br /><br />";
}
} else {
echo ""._MD_NOSUBMITTED."";
}
echo"</td></tr></table>";
xoops_cp_footer();
}

function linksConfigMenu()
{
global $xoopsDB,$xoopsConfig, $myts, $eh, $mytree;
// Add a New Main Category
xoops_cp_header();
$linkimg_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/modules/xdirectory/images/shots/");



I hope this will be useful.

I've seen the new version working on you riste and is superb, when is it going to be released?

Thanks again

4
builderb
Re: Xdirectory problem
  • 2004/1/10 21:38

  • builderb

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/8/4 2


I think I found the problem.

@ line# 152

replace this:
echo "<textarea name=description cols=\"60\" rows=\"5\">$description</text>\n";

with this:
echo "<textarea name=\"description\" cols=\"60\" rows=\"5\">$description</textarea>\n";

Let me know if that doesn't work.

-Builderb

P.S I'm getting the new module ready to release this weekend.

5
isaacbg
Re: Xdirectory problem
  • 2004/1/11 11:31

  • isaacbg

  • Just popping in

  • Posts: 4

  • Since: 2003/9/9 2


Gotcha, it worked!!!!!

Thanks a lot!!!