21
sceilig
Re: enable html in PM's
  • 2006/11/3 8:56

  • sceilig

  • Just popping in

  • Posts: 53

  • Since: 2006/3/1 1


Ive found it tough to troubleshoot the PM module when you get that dreaded empty Errors when trying to send a PM.
The Errors display when the $pm_handler->insert($pm) function fails but Ive never been able to follow the breadcrumbs succesfully to echo details about why it wouldnt insert.

But in this case, I believe if you add an integer column called "dohtml" to your priv_msgs table, you wont get the error.

Once you add the column, try adding the line back into pm/class/privmessage.php
--> $this->initVar("dohtml", XOBJ_DTYPE_INT, 1, false);

The other confusing thing about the PM module is that in some parts of pm/pmlite.php it makes a call to
--> $pm_handler =& xoops_getmodulehandler('privmessage');
and in another part to
--> $pm_handler =& xoops_gethandler('privmessage');
which refers to kernel/privmessage.php

Although that could be due to some other hacks I made to that module.

Hope that helps.

22
tzvook
Re: enable html in PM's
  • 2006/11/3 9:13

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Quote:

sceilig wrote:
I believe if you add an integer column called "dohtml" to your priv_msgs table, you wont get the error.

Once you add the column, try adding the line back into pm/class/privmessage.php
--> $this->initVar("dohtml", XOBJ_DTYPE_INT, 1, false);

Hope that helps.


Yep, help and make sence, but since usually when making a new XOOPS based site, I'm copying from an existing one, I try not to make table changes that will be forgotten afterwards ... had a bad expirience with that.

So it probably should be aded to the /sql/mysql.sql for future use as the folowing:
dohtml tinyint(2NOT NULL default '0',


But then it can also get it's own checkbox at the admin side of the PM .... making it a full hack ..... ????

23
tzvook
Re: enable html in PM's
  • 2006/11/3 9:19

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Thinking of that once more ... it's kind of essential with XOOPS today to support html in PM's ... due to the fact that almost every module might send PM's to users for all sort of info, and almost each module has it's hacks for supporting Wysiwyg editors and managing HTML content ...

So this one might be released as an "HTML enabled PM module" for the ones who need/want it ... for the 2.2.x series ...

there's probably some more hacks to the PM that might be handy and come under "enhanced PM module" .... please post your hacks and we'll gather them into one module...

24
sceilig
Re: enable html in PM's
  • 2006/11/3 9:59

  • sceilig

  • Just popping in

  • Posts: 53

  • Since: 2006/3/1 1


Sure - adding it to the mysql.sql is the way to go.

I think its a great idea to have an enhanced PM module.
Features where there already are released hacks:
-- option to send an email notification when a pm has been received
-- option to have a javascript popup appear saying you have a new pm when you login to the website.

One major hack I will be tackling in the coming months is coming up with a way to group users into subgroups. e.g. - administrator selects specific users to be part of a board of directors group or a committee. Also the ability of users to add themselves to say a book group. I would add these fields via the profiles module (Im using XOOPS v2.2.4).
Then for private messages if a user is part of a committee group they could send a pm to all the other members of the group by selecting that from a dropdown menu. Same would be true for users wanting to send a book review to other members of the book club as an example. I would also hack the evennews module to send newsletters to specific groups as well.

Ive heavily hacked my evennews module where I can preview a newsletter Im created, saving drafts and adding newsletters to a mail queue. The latter is how I got around the issue of sending a newsletter to a large number of recipients since a cron job runs every couple of hours and processes queued newsletters. Also I dont think the smartmail would suit my clients needs right now - too complex for non-techies to figure out.

25
tzvook
Re: enable html in PM's
  • 2006/11/3 10:42

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Quote:

sceilig wrote:
Sure - adding it to the mysql.sql is the way to go.

I think its a great idea to have an enhanced PM module.
Features where there already are released hacks:
-- option to send an email notification when a pm has been received
-- option to have a javascript popup appear saying you have a new pm when you login to the website.


I'll try to gather all this weekend and send it to you for review ... as I'm just a code hacker ... not a coder ...

Quote:

One major hack I will be tackling in the coming months is coming up with a way to group users into subgroups. e.g. - administrator selects specific users to be part of a board of directors group or a committee. Also the ability of users to add themselves to say a book group. I would add these fields via the profiles module (Im using XOOPS v2.2.4).
Then for private messages if a user is part of a committee group they could send a pm to all the other members of the group by selecting that from a dropdown menu. Same would be true for users wanting to send a book review to other members of the book club as an example. I would also hack the evennews module to send newsletters to specific groups as well.


Sounds interesting, I use 2.2.4 too, but I had a lot of issues with the Evenews not working good with large numbers of users (above 500 it start making problems and editing the php.ini is required) ... I poosted some threads about it in the past ...

Quote:

Ive heavily hacked my evennews module where I can preview a newsletter Im created, saving drafts and adding newsletters to a mail queue. The latter is how I got around the issue of sending a newsletter to a large number of recipients since a cron job runs every couple of hours and processes queued newsletters. Also I dont think the smartmail would suit my clients needs right now - too complex for non-techies to figure out.

[/quote]

have you touched it's "import users" function? it made me a lot of trouble ... with large no. of users.

Since sending to large no. was problematic too, how exactly you queued the whole thing ?

26
sceilig
Re: enable html in PM's
  • 2006/11/4 23:29

  • sceilig

  • Just popping in

  • Posts: 53

  • Since: 2006/3/1 1


My hacking of evennews turned it into a module that worked a bit different. I just wanted a newsletter module where I could send emails to the current users in the system, if they had the user_mailok preference set to Yes in their profile. For someone to subscribe or unsubscribe from the newsletter they just have to toggle that setting.

So I wouldnt have any need of importing users. On a side note, I will be coming up with a way to import users from a csv file into a XOOPS database - I have about 200 sites that I have to convert from phpnuke to XOOPS and transfer all the users. What makes that tricky is the user_profile table which has changeable columns. Not sure if there is a XOOPS import hack out there?

And for queueing newsletters here is the rough logic Im using.
When someone creates a newsletter, it is saved as a draft (mail_queue='N'). Then when they want to send it, they change that setting to 'Y'. I then wrote a phpscript which runs as a cron job every couple of hours. It connect to the XOOPS database and searches to see if there are any newsletter entries with mail_queue='Y'. If there is, I log myself in as an administrator using curl so I can execute a index.php?op=process_message script in the evennews admin directory. The process_message operation then sends out the newsletter to all recipients and it wont breakdown because the script is running as a cron rather than from the browser.

As I say a heavily hacked evennews. Perhap down the road I will add some failsafes so if the apache server restarted while the cron was running that I would have logged who all received the newsletter and who was still to receive it so the script could run again. Phplist uses a similar approach although thats a much more complex mailing list application.

27
tzvook
Re: enable html in PM's
  • 2006/11/7 22:17

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Quote:

sceilig wrote:
Phplist uses a similar approach although thats a much more complex mailing list application.


Yep, i used the feature a few times ...

200 sites that I have to convert from phpnuke to XOOPS and transfer all the usersWhat makes that tricky is the user_profile table which has changeable columnsNot sure if there is a XOOPS import hack out there?


200 sites to import ... ouch !!!
I know there is a hack, but not for the 2.2.2x series.

28
sceilig
Re: enable html in PM's
  • 2007/1/10 0:39

  • sceilig

  • Just popping in

  • Posts: 53

  • Since: 2006/3/1 1


Just an update to this topic.

I realized I didnt need to hack xoopsmailer.php to implement sending emails in text/html, text/plain or multipart/alternative formats. I could set variables directly in class.phpmailer.php.

To send an email as plain text
$xoopsMailer->multimailer->IsHTML(false);

To send an email as html
$xoopsMailer->multimailer->IsHTML(true);

To send an email as html with a text version included (multipart email)
$xoopsMailer->multimailer->AltBody = "text version of email";

To make a text version of a html message, I use the Html2Text class.

Sometimes bounced emails dont go to the Sender of the email -- this is due to the Return-Path being the default server email address and thats where the bounces endup (e.g. nobody@servername.com).

To force the Return-path variable:
$xoopsMailer->multimailer->Sender = $xoopsConfig[adminmail];

Perhaps someone may find this info useful.

29
Sama
Re: send email with html to site members
  • 2009/9/18 10:50

  • Sama

  • Just popping in

  • Posts: 3

  • Since: 2009/9/18


Quote:

tzvook wrote:
OK ... found the little error in it: ( missed the 'name'=>'description' before )

the full code for mailform.php (line 82) should be:

include_once(XOOPS_ROOT_PATH "/class/xoopseditor/inbetween/forminbetweentextarea.php");
$body_text = (new XoopsFormInbetweenTextArea(array('caption'=> $body_caption'name'=>'mail_body''value'=>$mail_body'width'=>'100%''height'=>'250px'),true));



So now as far as I tested all if fine and hack is great.
I would really like to get more test reports, though I tested it quite a bit under 2.2.3 , and inbetween is functioning well in here ... pictures path, smilies ... all is good ....

I think it'll be a nice addition to the core ( 2.2.5 ... ??? ... phppp ? ) ... with a wysiwyg selection box and all .... after all it's a long awaited option for a lot of users


Sorry, you can help me, I change a code, but i have same problem, blank page. my version of XOOPS 2.3.3

Login

Who's Online

356 user(s) are online (227 user(s) are browsing Support Forums)


Members: 0


Guests: 356


more...

Donat-O-Meter

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

Latest GitHub Commits