Home arrow Our Main FAQ

Does mosLM work on PHP5 ?

Of course it does silly :-)


mosListMessenger v2.0 and above have been created and tested on PHP5 with no problems.

mosListMessenger v1.0 will need to be patched in order to work correctly on PHP5

You need to modify slight places in the code.


1. Open functions.inc.php
2. Replace roughly around lines 385 - 388 which currently are:


function remove_linebreaks($this) {
$this = str_replace(\"\\n\", \"\", $this);
$this = str_replace(\"\\r\", \"\", $this);
return $this;
}

And change it to:
[CODE]

function remove_linebreaks($string) {
return str_replace(array(\"\\n\", \"\\r\"), array(\"\", \"\"), $string);
}

[/CODE]
2. Also in functions.inc.php roughly around lines 1003 - 1018 which currently is:
[CODE]

function show_total_subscribers() {
$result = mysql_query(\"SELECT COUNT(*) as `totalrows` FROM `\".TABLES_PREFIX.\"user_list`;\");
if(($result) && ($row=mysql_fetch_array($result))) {
$total = $row[\"totalrows\"];
if($total == 1) {
$this = \"\".$total.\" Subscriber\";
} else {
$this = \"\".$total.\" Subscribers\";
}
} else {
$this = \"No Subscribers\";
}

return $this;
}
[/CODE]
And change it to:
[CODE]

function show_total_subscribers() {
$output = \"\";
$result = mysql_query(\"SELECT COUNT(*) as `totalrows` FROM `\".TABLES_PREFIX.\"user_list`;\");
if(($result) && ($row=mysql_fetch_array($result))) {
$total = $row[\"totalrows\"];
if($total == 1) {
$output = \"\".$total.\" Subscriber\";
} else {
$output = \"\".$total.\" Subscribers\";
}
} else {
$output = \"No Subscribers\";
}

return $output;
}
[/CODE]

This last one isn\'t necessary unless you\'re trying to install ListMessenger for the first time on a PHP5 install.

You\'ll need to open setup/setup.php and roughly around lines 109 - 114 which currently is:
[CODE]

function remove_linebreaks($this) {
$this = str_replace(\"\\n\", \"\", $this);
$this = str_replace(\"\\r\", \"\", $this);
return $this;
}
[/CODE]
And change it to:
[CODE]

function remove_linebreaks($string) {
return str_replace(array(\"\\n\", \"\\r\"), array(\"\", \"\"), $string);
}
[/CODE]
Leave Comment Send by email

Leave A Comment

or close

Email This Article

or close

Existing Comments

There are currently no comments.

myNotes My Notes

You currently have no notes on this article. You can leave your own note on this page, the note can only be seen by you (and our administrators) but not other users.

You need to login first

Related Articles

The following articles may be related to this one:

  • No related Items

Does mosLM work on PHP5 ? Article Information

Hits:
4498
Created:
Sunday, 02 December 2007
Author:
Joomla Components
Last Modified:
Sunday, 02 December 2007
Access:
Public
Version:
5