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



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
9 - 6 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
   

Re: catads
by satrebil on 2011/10/16 14:17:23

Hi,

To make the DHTML editor supports HTML code is necessary to include the code that I have indicated in the previous post and change the reading of the fields we want that support HTML before editing.

For example if we want the description field supports HTML code should replace the
le="color: #000000"><?php $ads_desc = $ads->getVar('ads_desc');

by
le="color: #000000"><?php $ads_desc = $ads->getVar('ads_desc','e');

before editing in the forms.

In version 1.53 RC3 @ Peekay says that we must modify the line 280 of file adsedit.php with the code indicated above

The same as we do in all forms and in all the fields we want that support HTML

Satrebil
(Sorry for my bad English)
Re: catads
by Peekay on 2011/10/16 12:30:49

You can get the RC3 version of Catads 1.53 here on Sourceforge or from here on the Xoops Dev Forge.

There are a just a couple of small PHP notices to fix but the module works OK as far as I know. I haven't had time to update it at all this year, but I'll try and get a final version out by Christmas.

@ Satrebil
Many thx for posting that code.

@Mamba
You need to turn off debug on dev.xoops.org.

@jasXoop

Quote:
if ($xoopsModuleConfig['bbcode'] == 1) {
$text_annonce = new XoopsFormDhtmlTextArea(_MD_CATADS_TEXTE_S.'*', "ads_desc", $ads_desc);
} else {
$text_annonce = new XoopsFormTextArea(_MD_CATADS_TEXTE_S.'*', "ads_desc", $ads_desc);
} else {
$text_annonce = new ???????????????????(_MD_CATADS_TEXTE_S.'*', "ads_desc", $ads_desc);
} else {
$text_annonce = new ???????????????(_MD_CATADS_TEXTE_S.'*', "ads_desc", $ads_desc);
}


Yes, basically that is what would be needed.

There's a bit of work involved to add TinyMCE as an permanent module option because the editor is located in different places and the code to invoke it is also different depending on the version of Xoops. To keep the module usable in older versions of Xoops some version and/or file detection is also required.

When I get back, I'll take a look at getting the DHTML editor to support HTML as an option using the code posted by Satrebil as that might be a bit easier to implement.
Re: catads
by cpascal on 2011/10/15 10:31:09

you have DiffuAds 1.1 RC2 (following Catads) there is still a bit of work to make it especially adaptable for all countries.

you can download to try here, all grants and contributions are welcome
(google translation)
Re: catads
by satrebil on 2011/10/15 9:55:42

Hi,

What version of the catads module are you using?

Satrebil
Re: catads
by jasXoop on 2011/10/15 2:11:39

I have mad the change in the ads.phpas follows:


function CatadsAds()
{
$this->XoopsObject();
$this->initVar('ads_id', XOBJ_DTYPE_INT, null, false);
$this->initVar('cat_id', XOBJ_DTYPE_INT, null, true);
$this->initVar('ads_title', XOBJ_DTYPE_TXTBOX, null, true, 100);
$this->initVar('ads_type', XOBJ_DTYPE_TXTBOX, null, true, 40);
$this->initVar('ads_desc', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('ads_tags', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('ads_video', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('price', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('monnaie', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('price_option', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('email', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('uid', XOBJ_DTYPE_INT, 0, false);
$this->initVar('phone', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('pays', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('region', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('departement', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('town', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('codpost', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('created', XOBJ_DTYPE_INT, 0, false);
$this->initVar('published', XOBJ_DTYPE_INT, 0, false);
$this->initVar('expired', XOBJ_DTYPE_INT, 0, false);
$this->initVar('expired_mail_send', XOBJ_DTYPE_INT, 0, false);
$this->initVar('view', XOBJ_DTYPE_INT, 0, false);
$this->initVar('notify_pub', XOBJ_DTYPE_INT, 0, false);
$this->initVar('poster_ip', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('contact_mode', XOBJ_DTYPE_INT, 0, false);
$this->initVar('countpub', XOBJ_DTYPE_INT, 0, false);
$this->initVar('suspend', XOBJ_DTYPE_INT, 0, false);
//add v1.30
$this->initVar('waiting', XOBJ_DTYPE_INT, 0, false);
//add v1.40
$this->initVar('photo0', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('photo1', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('photo2', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('photo3', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('photo4', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('photo5', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('thumb', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('dohtml', XOBJ_DTYPE_INT, 1, false);

}


What is the correct syntax to have the editor as a choice. Does it need to be modified in each of the forms mentioned earlier? Thanks again!

// Formulaire avec ou sans bbcodes
if ($xoopsModuleConfig['bbcode'] == 1) {
$text_annonce = new XoopsFormDhtmlTextArea(_MD_CATADS_TEXTE_S.'*', "ads_desc", $ads_desc);
} else {
$text_annonce = new XoopsFormTextArea(_MD_CATADS_TEXTE_S.'*', "ads_desc", $ads_desc);
} else {
$text_annonce = new ???????????????????(_MD_CATADS_TEXTE_S.'*', "ads_desc", $ads_desc);
} else {
$text_annonce = new ???????????????(_MD_CATADS_TEXTE_S.'*', "ads_desc", $ads_desc);
}




Who's Online

128 user(s) are online (103 user(s) are browsing Support Forums)


Members: 0


Guests: 128


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