Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
7 - 2 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     
checkRight("jobs_premium", $perm_itemid, $groups, $module_id)) { $premium = 0; } else { $premium = 1; } function ListingDel($lid, $ok) { global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsTheme, $xoopsLogger, $mydirname, $main_lang; $result = $xoopsDB->query("select usid, p.lid, p.url FROM ".$xoopsDB->prefix("".$mydirname."_listing")." l LEFT JOIN ".$xoopsDB->prefix("".$mydirname."_pictures")." p ON l.lid=p.lid where l.lid=".mysql_real_escape_string($lid).""); list($usid, $plid, $purl) = $xoopsDB->fetchRow($result); if ($xoopsUser) { $currentid = $xoopsUser->getVar("uid", "E"); if ($usid == $currentid) { if($ok==1) { $xoopsDB->queryf("delete from ".$xoopsDB->prefix("".$mydirname."_listing")." where lid=".mysql_real_escape_string($lid).""); if ($purl) { $destination = XOOPS_ROOT_PATH."/modules/$mydirname/photo"; if (file_exists("$destination/$purl")) { unlink("$destination/$purl"); } $destination2 = XOOPS_ROOT_PATH."/modules/$mydirname/photo/thumbs"; if (file_exists("$destination2/thumb_$purl")) { unlink("$destination2/thumb_$purl"); } $destination3 = XOOPS_ROOT_PATH."/modules/$mydirname/photo/resized"; if (file_exists("$destination3/resized_$purl")) { unlink("$destination3/resized_$purl"); } } redirect_header("index.php",3,constant($main_lang."_ANNDEL")); exit(); } else { echo "\n"; echo ""; echo "".constant($main_lang."_SURDELANN").""; } echo "[ ".constant($main_lang."_OUI")." | ".constant($main_lang."_NON")." ]"; echo ""; } } } function DelReply($r_lid, $ok) { global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsTheme, $xoopsLogger, $mydirname, $main_lang; $result = $xoopsDB->query("select l.usid, r.r_lid, r.lid, r.title, r.date, r.submitter, r.message, r.tele, r.email, r.r_usid FROM ".$xoopsDB->prefix("".$mydirname."_listing")." l LEFT JOIN ".$xoopsDB->prefix("".$mydirname."_replies")." r ON l.lid=r.lid where r.r_lid=".mysql_real_escape_string($r_lid).""); list($usid, $r_lid, $rlid, $title, $date, $submitter, $message, $tele, $email, $r_usid) = $xoopsDB->fetchRow($result); if ($xoopsUser) { $currentid = $xoopsUser->getVar("uid", "E"); if ($usid == $currentid) { if($ok==1) { $xoopsDB->queryf("delete from ".$xoopsDB->prefix("".$mydirname."_replies")." where r_lid=".mysql_real_escape_string($r_lid).""); redirect_header("members.php?usid=".addslashes($usid)."",3,constant($main_lang."_REPLYDEL")); exit(); } else { echo "\n"; echo ""; echo "".constant($main_lang."_SURDELANN").""; } echo "[ ".constant($main_lang."_OUI")." | ".constant($main_lang."_NON")." ]"; echo ""; } } } function ModAd($lid) { global $xoopsDB, $xoopsModule, $xoopsConfig, $xoopsModuleConfig, $xoopsUser, $xoopsTheme, $myts, $xoopsLogger, $mydirname, $main_lang; include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; include_once XOOPS_ROOT_PATH."/modules/$mydirname/include/functions.php"; echo "\nfunction CLA(CLA) { var MainWindow = window.open (CLA, "_blank","width=500,height=300,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no");}\n"; include_once(XOOPS_ROOT_PATH."/modules/$mydirname/class/classifiedstree.php"); $mytree = new ClassifiedsTree($xoopsDB->prefix("".$mydirname."_categories"),"cid","pid"); $result = $xoopsDB->query("select lid, cid, title, status, expire, type, desctext, tel, price, typeprice, date, email, submitter, usid, town, country, contactby, premium, valid from ".$xoopsDB->prefix("".$mydirname."_listing")." where lid=".mysql_real_escape_string($lid).""); list($lid, $cide, $title, $status, $expire, $type, $desctext, $tel, $price, $typeprice, $date, $email, $submitter, $usid, $town, $country, $contactby, $premium, $valid) = $xoopsDB->fetchRow($result); $categories = classifieds_MygetItemIds("".$mydirname."_submit"); if(is_array($categories) && count($categories) > 0) { if(!in_array($cide, $categories)) { redirect_header(XOOPS_URL."/modules/$mydirname/index.php", 3, _NOPERM); exit(); } } else { // User can't see any category redirect_header(XOOPS_URL.'/index.php', 3, _NOPERM); exit(); } if ($xoopsUser) { $calusern = $xoopsUser->uid(); if ($usid == $calusern) { echo "".constant($main_lang."_MODIFANN").""; $title = $myts->htmlSpecialChars($title); $status = $myts->htmlSpecialChars($status); $expire = $myts->htmlSpecialChars($expire); $type = $myts->htmlSpecialChars($type); if ($xoopsModuleConfig["".$mydirname."_form_options"] == 'dhtmltextarea') { $desctext = $myts->displayTarea($desctext,0,0,0,0,0); } else { $desctext = $myts->displayTarea($desctext, 1,0,1,1,1); } $tel = $myts->htmlSpecialChars($tel); $price = number_format($price, 2, ".", ","); $typeprice = $myts->htmlSpecialChars($typeprice); $submitter = $myts->htmlSpecialChars($submitter); $town = $myts->htmlSpecialChars($town); $country = $myts->htmlSpecialChars($country); $contactby = $myts->htmlSpecialChars($contactby); $premium = $myts->htmlSpecialChars($premium); $useroffset = ""; if($xoopsUser) { $timezone = $xoopsUser->timezone(); if(isset($timezone)){ $useroffset = $xoopsUser->timezone(); }else{ $useroffset = $xoopsConfig['default_TZ']; } } $dates = ($useroffset*3600) + $date; $dates = formatTimestamp($date,"s"); echo " ".constant($main_lang."_NUMANNN")." $lid ".constant($main_lang."_DU")." $dates "; if ($xoopsModuleConfig["".$mydirname."_diff_name"] == "1") { echo "".constant($main_lang."_SENDBY")." "; }else{ echo "".constant($main_lang."_SENDBY")." $submitter"; } echo ""; echo " ".constant($main_lang."_CONTACTBY")." ".$contactby." ".constant($main_lang."_CONTACT_BY_EMAIL")." ".constant($main_lang."_CONTACT_BY_PM")." ".constant($main_lang."_CONTACT_BY_BOTH")." ".constant($main_lang."_CONTACT_BY_PHONE").""; if ($xoopsModuleConfig["".$mydirname."_diff_email"] == '1') { echo "".constant($main_lang."_EMAIL")." "; } else { echo "".constant($main_lang."_EMAIL")." $email"; } echo " ".constant($main_lang."_TEL")." "; echo " ".constant($main_lang."_TOWN")." "; if ($xoopsModuleConfig["".$mydirname."_use_country"] == '1') { echo " ".constant($main_lang."_COUNTRY")." "; } else { echo ""; } echo "".constant($main_lang."_STATUS")."".constant($main_lang."_ACTIVE")."   ".constant($main_lang."_INACTIVE")."   ".constant($main_lang."_SOLD").""; echo " ".constant($main_lang."_TITLE2")." "; echo "".constant($main_lang."_PRICE2")." ". $xoopsModuleConfig["".$mydirname."_money"].""; $result3 = $xoopsDB->query("select nom_price from ".$xoopsDB->prefix("".$mydirname."_price")." order by id_price"); echo " $typeprice"; while(list($nom_price) = $xoopsDB->fetchRow($result3)) { echo "$nom_price"; } echo ""; if ($premium == "1") { echo " ".constant($main_lang."_WILL_LAST")." $expire ".constant($main_lang."_DAY")." "; echo ""; } else { echo " ".constant($main_lang."_HOW_LONG")." ".constant($main_lang."_DAY")." "; } echo " ".constant($main_lang."_TYPE")." "; $result5=$xoopsDB->query("select nom_type from ".$xoopsDB->prefix("".$mydirname."_type")." order by nom_type"); while(list($nom_type) = $xoopsDB->fetchRow($result5)) { $sel = ""; if ($nom_type == $type) { $sel = "selected"; } echo "$nom_type"; } echo ""; echo " ".constant($main_lang."_CAT")." "; $mytree->makeMySelBox('title','title', $cide,'','cid'); echo " ".constant($main_lang."_DESC")." "; $wysiwyg_text_area= classifieds_getEditor( constant($main_lang."_DESC"), "desctext", $desctext, '100%', '200px'); echo $wysiwyg_text_area->render(); echo ""; echo " "; echo ""; if ($premium == "0") { if ($xoopsModuleConfig["".$mydirname."_moderated"] == '1') { echo ""; echo "".constant($main_lang."_MODIFBEFORE").""; } else { echo ""; } } else { echo ""; } echo ""; echo ""; echo " ".$GLOBALS['xoopsGTicket']->getTicketHtml( __LINE__ , 1800 , 'token').""; echo ""; } } } function ModAdS($lid, $cat, $title, $status, $expire, $type, $desctext, $tel, $price, $typeprice, $date, $email, $submitter, $town, $country, $contactby, $premium, $valid) { global $xoopsDB, $xoopsConfig, $xoopsModuleConfig, $myts, $xoopsLogger, $mydirname, $main_lang, $xoopsGTicket; if ( ! $xoopsGTicket->check( true , 'token' ) ) { redirect_header(XOOPS_URL."/modules/$mydirname/index.php", 3,$xoopsGTicket->getErrors()); } $title = $myts->addSlashes($title); $status = $myts->addSlashes($status); $expire = $myts->addSlashes($expire); $type = $myts->addSlashes($type); if ($xoopsModuleConfig["".$mydirname."_form_options"] == 'dhtmltextarea') { $desctext = $myts->displayTarea($desctext,0,0,0,0,0); } else { $desctext = $myts->displayTarea($desctext, 1,0,1,1,1); } $tel = $myts->addSlashes($tel); $price = str_replace(array(','), '', $price); $typeprice = $myts->addSlashes($typeprice); $submitter = $myts->addSlashes($submitter); $town = $myts->addSlashes($town); $country = $myts->addSlashes($country); $contactby = $myts->addSlashes($contactby); $premium = $myts->addSlashes($premium); $xoopsDB->query("update ".$xoopsDB->prefix("".$mydirname."_listing")." set cid='$cat', title='$title', status='$status', expire='$expire', type='$type', desctext='$desctext', tel='$tel', price='$price', typeprice='$typeprice', email='$email', submitter='$submitter', town='$town', country='$country', contactby='$contactby', premium='$premium', valid='$valid' where lid=$lid"); redirect_header("index.php",3,constant($main_lang."_ANNMOD2")); exit(); } #################################################### foreach ($_POST as $k => $v) { ${$k} = $v; } $ok = isset( $_GET['ok'] ) ? $_GET['ok'] : '' ; if(!isset($_POST['lid']) && isset($_GET['lid']) ) { $lid = $_GET['lid'] ; } if(!isset($_POST['r_lid']) && isset($_GET['r_lid']) ) { $r_lid = $_GET['r_lid'] ; } if(!isset($_POST['op']) && isset($_GET['op']) ) { $op = $_GET['op'] ; } switch ($op) { case "ModAd": include(XOOPS_ROOT_PATH."/header.php"); ModAd($lid); include(XOOPS_ROOT_PATH."/footer.php"); break; case "ModAdS": ModAdS($lid, $cid, $title, $status, $expire, $type, $desctext, $tel, $price, $typeprice, $date, $email, $submitter, $town, $country, $contactby, $premium, $valid); break; case "ListingDel": include(XOOPS_ROOT_PATH."/header.php"); ListingDel($lid, $ok); include(XOOPS_ROOT_PATH."/footer.php"); break; case "DelReply": include(XOOPS_ROOT_PATH."/header.php"); DelReply($r_lid, $ok); include(XOOPS_ROOT_PATH."/footer.php"); break; default: redirect_header("index.php",3,_RETURNANN); break; } ?> [/code][/quote]" />

Re: Classifieds_2.4 - Parse error
by Peekay on 2010/5/19 14:22:24

There is a problem on Xoops.org forum when quoting posts containing code.

It has been reported.

I don't know if this is a CBB bug, or just an XO bug, but it would be nice to have it fixed.
Re: Classifieds_2.4 - Parse error
by TexAcoon on 2010/5/19 12:25:28

@culex ... Yes I'm using 2.4 .. Did try the code you gave me and it did not work ..

@ghia .. I'll give it a try latter today ..

Off to work I go ....

Thanks Guys!
Re: Classifieds_2.4 - Parse error
by ghia on 2010/5/19 8:20:15

The code window may have distorted some code:
echo "[ <a href="modify.php?op=ListingDel&lid=".addslashes($lid)."&ok=1">".constant($main_lang."_OUI")."</a> | <a href="viewad.php?lid=".addslashes($lid)."">".constant($main_lang."_NON")."</a> ]<br /><br />";

eg ."&ok=1">". and ."">".

Better is to use ' for string delimiter allowing easy use of " inside.

echo '[ <a href="modify.php?op=ListingDel&lid='.addslashes($lid).'&ok=1">'.constant($main_lang."_OUI").'</a> | <a href="viewad.php?lid='.addslashes($lid).'">'.constant($main_lang."_NON").'</a> ]<br /><br />';
Re: Classifieds_2.4 - Parse error
by culex on 2010/5/18 19:28:28

Are you sure this is version 2.4 your using ?

On line 79 I have

le="color: #000000"><?php echo "[ <a href="modify.php?op=ListingDel&amp;lid=".addslashes($lid)."&amp;ok=1">".constant($main_lang."_OUI")."</a> | <a href="viewad.php?lid=".addslashes($lid)."">".constant($main_lang."_NON")."</a> ]<br /><br />";
Re: Classifieds_2.4 - Parse error
by TexAcoon on 2010/5/17 13:03:14

Thanks Culex,,


Gave it a try and still picked up a parse error ..

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in modules/classifieds/modify.php on line 79


I took a look on line 79 and did not show me an expected string as mentioned ..

Here is a copy of line 79

list($usid, $plid, $purl) = $xoopsDB->fetchRow($result);

if ($xoopsUser) { LINE 79
$currentid = $xoopsUser->getVar("uid", "E");
if ($usid == $currentid) {
if($ok==1) {

Who's Online

125 user(s) are online (82 user(s) are browsing Support Forums)


Members: 0


Guests: 125


more...

Donat-O-Meter

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

Latest GitHub Commits