• [MOD] PMv2 Tutorial Republished here 5 0 5 1
Currently:  

Author Topic: [MOD] PMv2 Tutorial Republished here  (Read 771088 times)

0 Members and 3 Guests are viewing this topic.

Offline arabcine

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: [MOD] PMv2 Tutorial Republished here
« Reply #630 on: September 23, 2009, 11:33:21 AM »
hi all


any mod for pm members can send pm to other members

 i saw one here but is very old

any new?

Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
Re: [MOD] PMv2 Tutorial Republished here
« Reply #631 on: September 23, 2009, 03:17:55 PM »
Hi! Is there a current HowTo to install this mod PM v2? reagrds clubsociety
It's not working in 1.7.7

What issues are you guys having with getting this installed on 1.7.7?

I have this installed on my 1.7.7

Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
Re: [MOD] PMv2 Tutorial Republished here
« Reply #632 on: September 23, 2009, 05:42:13 PM »
Why would you need a new one?

PM v2 works perfectly fine

http://www.4homepages.de/forum/index.php?topic=6692.0

Offline arabcine

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: [MOD] PMv2 Tutorial Republished here
« Reply #633 on: September 24, 2009, 05:55:36 AM »
many things lost in 1. 7. 7  iam tryin to do it but in step 6 in


-------------------------
and at the end of the function find (in default 4images it would be):

Code:  [Select]  [Expand]  [Hide line numbers]

return replace_badwords($text);
}
 
add after that closing bracket } add this:
 
*/ 


-------------------------------------


in step 6. 1

but iam not find this

can you give me your email on msn



Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
Re: [MOD] PMv2 Tutorial Republished here
« Reply #634 on: September 24, 2009, 06:04:48 AM »
Its there....

In includes/functions.php find:
Code: [Select]
function format_text($text, $html = 0, $word_wrap = 0, $bbcode = 0, $bbcode_img = 0) {
  if ($word_wrap && $text != "") {
    $text = preg_replace("/([^\n\r ?&\.\/<>\"\\-]{".$word_wrap."})/i", " \\1\n", $text);
  }

  if ($html == 0 || $html == 2) {
    $text = safe_htmlspecialchars($text);
  }

  // Replace { to prevent parsing in templates
  global $site_template;
  $text = preg_replace(
    '='.preg_quote($site_template->start).'([A-Z0-9_]+)'.preg_quote($site_template->end).'=Usi',
    '&#123;\1&#125;',
    $text
  );

  if ($html !== 2) {
    $text = nl2br(trim($text));
    $text = replace_url($text);
  }

  if ($bbcode == 1) {
    $search_array = array(
      "/(\[)(list)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/list)(((=)(\\4)([^\"']*)(\\4]))|(\]))/siU",
      "/(\[)(list)(])(.*)(\[\/list\])/siU",
      "/(\[\*\])/siU",
      "/(\[\/\*\])/siU",
      "/(\[)(url)(=)(['\"]?)(www\.)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
      "/(\[)(url)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
      "/(\[)(url)(])(www\.)([^\"]*)(\[\/url\])/siU",
      "/(\[)(url)(])([^\"]*)(\[\/url\])/siU",
      "/(\[)(code)(])(\r\n)*(.*)(\[\/code\])/siU",
      "/javascript:/si",
      "/about:/si"
    );
    $replace_array = array(
      "<ol type=\"\\5\">\\7</ol>",
      "<ul>\\4</ul>",
      "<li>",
      "</li>",
      "<a href=\"http://www.\\6\" target=\"_blank\" rel=\"nofollow\">\\8</a>",
      "<a href=\"\\5\" target=\"_blank\" rel=\"nofollow\">\\7</a>",
      "<a href=\"http://www.\\5\" target=\"_blank\" rel=\"nofollow\">www.\\5</a>",
      "<a href=\"\\4\" target=\"_blank\" rel=\"nofollow\">\\4</a>",
      "<pre>Code:<hr size=1>\\5<hr size=1></pre>",
      "java script:",
      "about :"
    );
    $text = preg_replace($search_array, $replace_array, $text);
    if (!$bbcode_img)  {
      $text = preg_replace("/(\[)(img)(])(\r\n)*([^\"]*)(\[\/img\])/siU", "<a href=\"\\5\" target=\"_blank\">\\5</a>", $text);
    }
    else  {
      $text = preg_replace("/(\[)(img)(])(\r\n)*([^\"]*)(\[\/img\])/siU", "<img src=\"\\5\">", $text);
    }
    $text = preg_replace("/(\[)(b)(])(\r\n)*([^\"]*)(\[\/b\])/siU", "<b>\\5</b>", $text);
    $text = preg_replace("/(\[)(i)(])(\r\n)*([^\"]*)(\[\/i\])/siU", "<i>\\5</i>", $text);
    $text = preg_replace("/(\[)(u)(])(\r\n)*([^\"]*)(\[\/u\])/siU", "<u>\\5</u>", $text);

    $text = replace_badwords($text);
  }

  $text = str_replace("\\'", "'", $text);

  return $text;
}

Replace with

Code: [Select]
/*
function format_text($text, $html = 0, $word_wrap = 0, $bbcode = 0, $bbcode_img = 0) {
  if ($word_wrap && $text != "") {
    $text = preg_replace("/([^\n\r ?&\.\/<>\"\\-]{".$word_wrap."})/i", " \\1\n", $text);
  }

  if ($html == 0 || $html == 2) {
    $text = safe_htmlspecialchars($text);
  }

  // Replace { to prevent parsing in templates
  global $site_template;
  $text = preg_replace(
    '='.preg_quote($site_template->start).'([A-Z0-9_]+)'.preg_quote($site_template->end).'=Usi',
    '&#123;\1&#125;',
    $text
  );

  if ($html !== 2) {
    $text = nl2br(trim($text));
    $text = replace_url($text);
  }

  if ($bbcode == 1) {
    $search_array = array(
      "/(\[)(list)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/list)(((=)(\\4)([^\"']*)(\\4]))|(\]))/siU",
      "/(\[)(list)(])(.*)(\[\/list\])/siU",
      "/(\[\*\])/siU",
      "/(\[\/\*\])/siU",
      "/(\[)(url)(=)(['\"]?)(www\.)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
      "/(\[)(url)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
      "/(\[)(url)(])(www\.)([^\"]*)(\[\/url\])/siU",
      "/(\[)(url)(])([^\"]*)(\[\/url\])/siU",
      "/(\[)(code)(])(\r\n)*(.*)(\[\/code\])/siU",
      "/javascript:/si",
      "/about:/si"
    );
    $replace_array = array(
      "<ol type=\"\\5\">\\7</ol>",
      "<ul>\\4</ul>",
      "<li>",
      "</li>",
      "<a href=\"http://www.\\6\" target=\"_blank\" rel=\"nofollow\">\\8</a>",
      "<a href=\"\\5\" target=\"_blank\" rel=\"nofollow\">\\7</a>",
      "<a href=\"http://www.\\5\" target=\"_blank\" rel=\"nofollow\">www.\\5</a>",
      "<a href=\"\\4\" target=\"_blank\" rel=\"nofollow\">\\4</a>",
      "<pre>Code:<hr size=1>\\5<hr size=1></pre>",
      "java script:",
      "about :"
    );
    $text = preg_replace($search_array, $replace_array, $text);
    if (!$bbcode_img)  {
      $text = preg_replace("/(\[)(img)(])(\r\n)*([^\"]*)(\[\/img\])/siU", "<a href=\"\\5\" target=\"_blank\">\\5</a>", $text);
    }
    else  {
      $text = preg_replace("/(\[)(img)(])(\r\n)*([^\"]*)(\[\/img\])/siU", "<img src=\"\\5\">", $text);
    }
    $text = preg_replace("/(\[)(b)(])(\r\n)*([^\"]*)(\[\/b\])/siU", "<b>\\5</b>", $text);
    $text = preg_replace("/(\[)(i)(])(\r\n)*([^\"]*)(\[\/i\])/siU", "<i>\\5</i>", $text);
    $text = preg_replace("/(\[)(u)(])(\r\n)*([^\"]*)(\[\/u\])/siU", "<u>\\5</u>", $text);

    $text = replace_badwords($text);
  }

  $text = str_replace("\\'", "'", $text);

  return $text;
}
*/



Offline arabcine

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: [MOD] PMv2 Tutorial Republished here
« Reply #635 on: September 24, 2009, 06:30:08 AM »
thanks dear now iam in Step 7
 
Open /includes/page_header.php


what i can set because iam not find same lines

$site_template->register_vars(array(
  "media_url" => MEDIA_PATH,



in 1.7.7

ihave see this :

$site_template->register_vars(array(
  "home_url"  => ROOT_PATH,
  "media_url" => MEDIA_PATH,

--- what i have to do now

Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
Re: [MOD] PMv2 Tutorial Republished here
« Reply #636 on: September 24, 2009, 06:40:49 AM »
You should be asking these questions in the original thread

find
Code: [Select]
$site_template->register_vars(array(
  "home_url"  => ROOT_PATH
  "media_url" => MEDIA_PATH,

replace with

Code: [Select]
//-----------------------------------------------------
//--- pm ---------------------------------------------
//-----------------------------------------------------
$inbox = "";
$outbox = "";
$sentbox = "";
$newpm = "";
$pm_popup_script = "";
$pm_popup_head = "";
$pm = "";
if ($config['pm'] && $user_info['user_level'] >= USER) {
  $sql = "SELECT COUNT(pm_id) AS total
              FROM ".PM_TABLE."
              WHERE pm_to = ".$user_info['user_id']." AND (pm_type = ".PM_SENT." OR pm_type = ".PM_SDLT." OR pm_type = ".PM_UNREAD." OR pm_type = ".PM_USDLT.")";
  $result = $site_db->query_firstrow($sql);
  $pm_inbox = $result['total'];
  $sql = "SELECT COUNT(pm_id) AS total
              FROM ".PM_TABLE."
              WHERE pm_from = ".$user_info['user_id']." AND (pm_type = ".PM_UNREAD." OR pm_type = ".PM_USDLT.")";
  $result = $site_db->query_firstrow($sql);
  $pm_outbox = $result['total'];
  $sql = "SELECT COUNT(pm_id) AS total
              FROM ".PM_TABLE."
              WHERE pm_from = ".$user_info['user_id']." AND (pm_type = ".PM_SENT." OR pm_type = ".PM_RDLT.")";
  $result = $site_db->query_firstrow($sql);
  $pm_sentbox = $result['total'];
  $sql = "SELECT COUNT(pm_id) AS new
              FROM ".PM_TABLE."
              WHERE pm_to = ".$user_info['user_id']." AND (pm_type = ".PM_UNREAD." OR pm_type = ".PM_USDLT.")
              ORDER BY pm_date DESC";
  $result = $site_db->query_firstrow($sql);
  $pm_new_count = $result['new'];
  $sql = "SELECT pm_date
              FROM ".PM_TABLE."
              WHERE pm_to = ".$user_info['user_id']." AND (pm_type = ".PM_UNREAD." OR pm_type = ".PM_USDLT.")
              ORDER BY pm_date DESC";
  $result = $site_db->query_firstrow($sql);
  $pm_new = "<a href=\"".$site_sess->url(ROOT_PATH."pm.php")."\">".(($pm_new_count) ? "<blink>".$pm_new_count."</blink>" : 0)."</a>";
  $pm = preg_replace("/".$site_template->start."msg_new_count".$site_template->end."/siU", $pm_new, $lang['pm_link']);
  $pm = preg_replace("/".$site_template->start."inbox".$site_template->end."/siU", "<a href=\"".$site_sess->url(ROOT_PATH."pm.php")."\">".$lang['pm_inbox']."</a>", $pm);
  $blink = "<script language=\"JavaScript\">\n<!--\nvar flg=0;\nfunction blink(){\nvar myElement=document.getElementById('blnk');\nflg^=1;\nif(flg==1){\nmyElement.style.visibility='hidden';\n}\nelse{\nmyElement.style.visibility='visible';\n}\ntimerID = setTimeout( 'blink()' , 500 );\n}\n//-->\n</script>\n";
  $show_inbox = ($pm_new_count) ? $blink."<span id=\"blnk\">".$lang['pm_inbox']."</span><script language=\"JavaScript\">blink();</script>" : $lang['pm_inbox'];
  $inbox = "<a href=\"".$site_sess->url(ROOT_PATH."pm.php?action=inbox")."\" title=\"".(($pm_new_count) ? $lang['pm_new_messages'].": ".$pm_new_count."\n" : "").$lang['pm_total'].": ".$pm_inbox."\">".$show_inbox."</a>";
  $sentbox = "<a href=\"".$site_sess->url(ROOT_PATH."pm.php?action=sentbox")."\" title=\"".$lang['pm_total'].": ".$pm_sentbox."\">".$lang['pm_sentbox']."</a>";
  $outbox = "<a href=\"".$site_sess->url(ROOT_PATH."pm.php?action=outbox")."\" title=\"".$lang['pm_total'].": ".$pm_outbox."\">".$lang['pm_outbox']."</a>";
  $newpm = "<a href=\"".$site_sess->url(ROOT_PATH."pm.php?action=new")."\">".$lang['pm_new']."</a>";

  if ($result && $user_info['user_pm_popup']) {
     $cookie_name = (defined("COOKIE_NAME")) ? COOKIE_NAME : "4images_";
     $cookie_pmnewpopup = isset($HTTP_COOKIE_VARS[$cookie_name.'pmnewpopup']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookie_name.'pmnewpopup'])) : 0;
     if ($cookie_pmnewpopup < $result['pm_date']) {
      if (ereg("pm.php", $self_url) && $action == "inbox") {
          $cookie_expire = time() + 60 * 60 * 24 * 90;
          setcookie($cookie_name.'pmnewpopup', serialize($result['pm_date']), $cookie_expire, COOKIE_PATH, COOKIE_DOMAIN, COOKIE_SECURE);
      }elseif (!ereg("pm.php", $self_url) || (ereg("pm.php", $self_url) && ($action == "sentbox" || $action == "outbox"))){
        $cookie_expire = gmdate('D, d M Y H:i:s \G\M\T', time() + 60 * 60 * 24 * 90);
        $pm_popup_script = " <script language=\"JavaScript\">
        <!--
        function SetCookie (name, value, expire, path, domain, secure) {
          document.cookie = name + '=' + escape(value) + ((expire)?(';expires=' + expire):'') + ((path)?';path=' + path:'') + ((domain)?';domain=' + domain:'') + ((secure && (secure == true))?'; secure':'');
        }
        function confirm_newpm() {
          input_box=confirm('".$lang['pm_popup_confirm']."');
          if (input_box==true) { // Output when OK is clicked
            second_box=confirm('".$lang['pm_popup_newwindow']."');
            if (second_box==true) {
              SetCookie('".$cookie_name."pmnewpopup','".serialize($result['pm_date'])."','".$cookie_expire."','".COOKIE_PATH."','".COOKIE_DOMAIN."','".COOKIE_SECURE."');
              window.open('".$site_sess->url(ROOT_PATH."pm.php")."','pmnew','width=600,height=500,menubar=yes,scrollbars=yes,toolbar=yes,location=yes,directories=yes,resizable=yes,top=50,left=50');
            } else {
              SetCookie('".$cookie_name."pmnewpopup','".serialize($result['pm_date'])."','".$cookie_expire."','".COOKIE_PATH."','".COOKIE_DOMAIN."','".COOKIE_SECURE."');
              window.location='".$site_sess->url(ROOT_PATH."pm.php")."';
            }
          } else {
            SetCookie('".$cookie_name."pmnewpopup','".serialize($result['pm_date'])."','".$cookie_expire."','".COOKIE_PATH."','".COOKIE_DOMAIN."','".COOKIE_SECURE."');
          }
        }
        // -->
      </script>";
        $pm_popup_header = " onload=\"Javascript:confirm_newpm()\"";
       }
    }
  }
}
$site_template->register_vars(array(
  "pm" => $pm,
  "pm_boxes" => ($inbox) ? $inbox."&nbsp;&nbsp;|&nbsp;&nbsp;".$sentbox."&nbsp;&nbsp;|&nbsp;&nbsp;".$outbox."&nbsp;&nbsp;|&nbsp;&nbsp;".$newpm : "",
  "pm_inbox" => $inbox,
  "pm_sentbox" => $sentbox,
  "pm_outbox" => $outbox,
  "pm_newpm" => $newpm,
  "pm_popup_script" => $pm_popup_script,
  "pm_popup_header" => $pm_popup_header,
  "bbcode2" => (BBCODE == "bbcode") ? 0 : 1,
  "pm_inbox_total" => ($pm_inbox) ? $pm_inbox : 0,
  "pm_outbox_total" => ($pm_outbox) ? $pm_outbox : 0,
  "pm_sentbox_total" => ($pm_sentbox) ? $pm_sentbox : 0,
  "pm_new_total" => ($pm_new_count) ? $pm_new_count : 0,
  "home_url"  => ROOT_PATH,
  "media_url" => MEDIA_PATH,
« Last Edit: September 24, 2009, 07:15:18 AM by impss »

Offline arabcine

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: [MOD] PMv2 Tutorial Republished here
« Reply #637 on: September 24, 2009, 07:01:46 AM »
i have differnt lines

$site_template->register_vars(array(
  "home_url"  => ROOT_PATH,               <== new   
  "media_url" => MEDIA_PATH,


this i have what i have to do now? remove this or what

Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
Re: [MOD] PMv2 Tutorial Republished here
« Reply #638 on: September 24, 2009, 07:15:47 AM »
yes replace that

i updated my above post

Offline arabcine

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: [MOD] PMv2 Tutorial Republished here
« Reply #639 on: September 24, 2009, 07:27:37 AM »
i did now

Step 9
 
In your browser start pm_install.php
* in address bar type something like this: http://<YOURSITE>/4images/pm_install.php
Finish the installation.



i uploaded all fines in my root and i did


http://www.?????.com/4iamages/pm_install.php


i got this error


--------------
SHOW TABLES LIKE '4images\_pm'



MOD Private Messaging v2    (by V@no)
  
 
Sorry, can not continue, you missed some steps of the installation..


------------------------------



and when i used this
http://www.?????.com/4iamages/pm.php


i got this

Fatal error: Call to undefined function format_text() in /home/arabcine/public_html/4iamages/includes/functions.php on line 1290

what i can to do now ?

thanks for your help.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] PMv2 Tutorial Republished here
« Reply #640 on: September 24, 2009, 08:51:24 AM »
It seems you've already ran pm_install.php once before, you don't need it run again.

Now, did you do step 6.2?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline arabcine

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: [MOD] PMv2 Tutorial Republished here
« Reply #641 on: September 24, 2009, 09:35:40 AM »
It seems you've already ran pm_install.php once before, you don't need it run again.

Now, did you do step 6.2?


no because iam not installed Smiles mod , i have to do this?
and when i put this
http://www.?????.com/test/pm.php

i got Fatal error: Call to undefined function format_text() in /home/arabcine/public_html/test/includes/functions.php on line 1290

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.805
  • I ♥ 4I
    • View Profile
Re: [MOD] PMv2 Tutorial Republished here
« Reply #642 on: September 24, 2009, 02:47:15 PM »
Please write any user an Update for This Mod :D

Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
Re: [MOD] PMv2 Tutorial Republished here
« Reply #643 on: September 24, 2009, 02:53:10 PM »
If you are installing this mod for the first time, and not upgrading from pms

In /includes/constants.php
Before the closing ?> Add:
Code: [Select]
//PM V2
define('PM_TABLE', $table_prefix.'pm');
define('PM_RDLT', 0); //Recipient deleted message (message only in: Sender's Setbox)
define('PM_SDLT', 1); //Sender deleted message (message only in: Recipient's Inbox)
define('PM_SENT', 2); //Recipient read message (message in: Sender's Sentbox and Recipient's Inbox)
define('PM_UNREAD', 3); //Recipient not read message (message in: Sender's Outbox and Recipient's Inbox - New Message)
define('PM_USDLT', 4);

That should let the installer work

Offline arabcine

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: [MOD] PMv2 Tutorial Republished here
« Reply #644 on: September 24, 2009, 03:09:00 PM »
impes i did

In /includes/constants.php

  done

and installed database
-------------------------------
Database successfuly updated!

Done  CREATE TABLE `4images_pm` ( `pm_id` mediumint(10) unsigned NOT NULL auto_increment, `pm_type` tinyint(2) NOT NULL default '0', `pm_to`
-------------------------------



now when i do http://www.????.com/test/pm.php

i got this error    Fatal error: Call to undefined function format_text() in /home/arabcine/public_html/test/includes/functions.php on line 1290


what i can to do now ? please help me