1
jasXoop
catads
  • 2011/10/13 5:40

  • jasXoop

  • Just popping in

  • Posts: 22

  • Since: 2003/10/1


I am looking for some information regarding catads.

When I adding the text in the ad description field, it only allows me to enter plain text, but I want to add html text in that box.

Can anyone suggest how and what o modify to get a different editor to work which will allow html in the ad desc field?

Thank you,

Jas

2
Peekay
Re: catads
  • 2011/10/13 18:03

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


I don't have the module code to hand at the moment, but I suppose it could be changed.

The current options are plain text (XoopsFormTextArea) and 'BB Code' (XoopsFormDhtmlTextArea) based on a module pref.

To add HTML support you would need to hack the module to use Tinyeditor instead. You should find some info here on XO about changing the code. It's just a few lines you'll need to search for and replace.

I believe you can add a parameter that enables HTML to be used with XoopsFormDhtmlTextArea but I have never seen an explanation of how to do it.

The reason HTML is prohibited by default in Catads is to stop advertisers creating monsterous ads full of oversized text, iFrames or other unpleasant surprises. If you plan to run this on a public site I would think twice about providing more formatting options than the DHTML editor allows.
A thread is for life. Not just for Christmas.

3
jasXoop
Re: catads
  • 2011/10/13 20:19

  • jasXoop

  • Just popping in

  • Posts: 22

  • Since: 2003/10/1


Hello,

Thanks for the reply.

Which file do I have to look at.

It is just for my use.

Jas

4
Peekay
Re: catads
  • 2011/10/13 22:17

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


I downloaded the module and assuming you're using Catads 1.53, you need to edit:

form1_ads.inc.php
form2_ads.inc.php
form3_ads.inc.php

The only thing I don't have is the Tinyeditor code to replace 'XoopsFormDhtmlTextArea', but you should be able to copy this from one of the newer modules, for example in the new module packs.
A thread is for life. Not just for Christmas.

5
jasXoop
Re: catads
  • 2011/10/14 3:32

  • jasXoop

  • Just popping in

  • Posts: 22

  • Since: 2003/10/1


I am not sure why you are recommending tiny editor.

In the function.php the following code is there.


if ($xoopsModuleConfig['bbcode'] == 1) {
$annonce_text = new XoopsFormDhtmlTextArea(_AM_CATADS_DESCR, "ads_desc", $ads_desc);
} else {
$annonce_text = new XoopsFormTextArea(_AM_CATADS_DESCR, "ads_desc", $ads_desc);
}
$adsform->addElement($annonce_text, true);


I am confused.


6
Peekay
Re: catads
  • 2011/10/14 8:01

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


By default, the first option (new XoopsFormDhtmlTextArea) doesn't do HTML, only BB codes. The second option (new XoopsFormTextArea) is plain text only.

For HTML, you would need to replace one of these with 'new tinyeditor' or something. The TinyMCE editor is included with Xoops. To do the job properly, you would add it as a third option and make it a pref.

I am away from my PC and don't have access to the exact code at the moment. Hopefully, someone else can help. If not, I'll post the code for you next week.
A thread is for life. Not just for Christmas.

7
satrebil
Re: catads
  • 2011/10/14 20:04

  • satrebil

  • Just popping in

  • Posts: 15

  • Since: 2009/5/3 2


Hi,

The first thing we have to do is get catads HTML support.

This requires modifying the ads.php file which is located in the subdirectory class
We need to add at the end of CatadsAds function () the following code:
$this->initVar('dohtml'XOBJ_DTYPE_INT1false);


Once we've done this we can change the editing of the fields to allow you edit HTML with DHTML or TinyMCE

Satrebil
(Sorry for my bad English)

8
jasXoop
Re: catads
  • 2011/10/15 2:11

  • jasXoop

  • Just popping in

  • Posts: 22

  • Since: 2003/10/1


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);
}





9
satrebil
Re: catads
  • 2011/10/15 9:55

  • satrebil

  • Just popping in

  • Posts: 15

  • Since: 2009/5/3 2


Hi,

What version of the catads module are you using?

Satrebil

10
cpascal
Re: catads
  • 2011/10/15 10:31

  • cpascal

  • Just popping in

  • Posts: 26

  • Since: 2010/3/20


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)
text translated by google translation

Login

Who's Online

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


Members: 0


Guests: 133


more...

Donat-O-Meter

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

Latest GitHub Commits