4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: V@no on April 30, 2003, 10:23:09 PM

Title: [MOD] Private Message System (PMS) not supported anymore!
Post by: V@no on April 30, 2003, 10:23:09 PM
------------------------------------------------
This MOD originaly was created by Cr@zy Sash, but after I tryed to troubleshooting it, I got an idea how to make it more advanced and using only one entry in the database for each message instead of doublicating for each folder.
Still 51% of credit goes to Cr@zy Sash ;) :D
------------------------------------------------

-----------| Overview |-----------------------
With this MOD members will be able send private messages to other members.
Each member has 3 folders:
- Inbox
- Sentbox
- Outbox

Q: Whats the difference betwen Sentbox and Outbox?
A: In Sentbox stores messages that have been received (the recipient read them). In Outbox stores messages that have not been received (the recipient has not read them yet).
Advantage of having Outbox is that u can edit messages from that folder (only).
---- Updated 5-03-2003 2pm (EST) ----
Now also, members can set to receive email notify or open popup window when received new message.


-----------| Changed Files |--------------------
/member.php
/details.php
/includes/constants.php
/includes/page_header.php
/lang/<yourlanguage>/main.php
<templates of your chose>

---- Updated 5-03-2003 2pm (EST) ----
/includes/db_field_definitions.php
/templates/<yourtemplate>/member_editprofile.html
/templates/<yourtemplate>/header.html



-----------| New file |---------------------------
pms.php

-----------| New templates |--------------------
pms.html
pms_folder.html
pms_view.html
pms_new.html
pms_delete.html
pms_perpage_dropdown_form.html

---- new added 5-03-2003 2pm (EST) ----
pms_notify.html

-----------| New images |----------------------
asc_order.png
desc_order.png


-----------| Installation |-----------------------

Step 1. Updated 5-03-2003 2pm (EST)
Download "PMS (http://come.no-ip.com/files.php?id=11)" package.
Extract files acording this:
/pms.php
/pms_install.php
/templates/<yourtemplate>/pms.html
/templates/<yourtemplate>/pms_delete.html
/templates/<yourtemplate>/pms_folder.html
/templates/<yourtemplate>/pms_new.html
/templates/<yourtemplate>/pms_view.html
/templates/<yourtemplate>/pms_perpage_dropdown_form.html
/templates/<yourtemplate>/images/asc_order.png
/templates/<yourtemplate>/images/desc_order.png

---- new added 5-03-2003 2pm (EST) ----
/lang/<yourlanguage>/email/notify.html


Step 2.
Open /includes/constants.php
At the end of the file, just before closing ?> add this:
Code: [Select]
//PMS
define('PMS_TABLE', $table_prefix.'pms');
define('PMS_RDLT', 0); //Recipient deleted message (message only in: Sender's Setbox)
define('PMS_SDLT', 1); //Sender deleted message (message only in: Recipient's Inbox)
define('PMS_SENT', 2); //Recipient read message (message in: Sender's Sentbox and Recipient's Inbox)
define('PMS_UNREAD', 3); //Recipient not read message (message in: Sender's Outbox and Recipient's Inbox - New Message)


Step 3. Updated 5-03-2003 2pm (EST)
Open /lang/<yourlanguage>/main.php
At the end of the file, just before closing ?> add this:
Code: [Select]
//--- PMS ----
$lang['pms_inbox'] = "Inbox";
$lang['pms_outbox'] = "Outbox";
$lang['pms_sentbox'] = "Sentbox";
$lang['pms_link'] = "&nbsp;&nbsp;&nbsp;You have<br />&raquo&nbsp;<b>{msg_new_count}</b> new message(s)<br />&nbsp;&nbsp;&nbsp;in your <b>{inbox}</b>.";
$lang['pms'] = "Private Messaging";
$lang['pms_short'] = "PMS";
$lang['pms_error'] = "Error";
$lang['pms_error_to'] = "You must select a recipient.";
$lang['pms_error_subject'] = "You must enter a subject.";
$lang['pms_error_message'] = "You must enter a message.";
$lang['pms_error_folder'] = "No folder selected.";
$lang['pms_error_id'] = "Nothing to show.";
$lang['pms_error_delete'] = "Nothing to delete.";
$lang['pms_compose'] = "Compose";
$lang['pms_delete'] = "Delete";
$lang['pms_delete_selected'] = "Delete selected";
$lang['pms_delete_all'] = "Delete all";
$lang['pms_delete_success'] = "The messages where deleted successfuly";
$lang['pms_delete_confirm'] = "Are you sure you want to delete that message from <b>".$lang['pms_'.$mode]."</b>?";
$lang['pms_delete_confirm_select'] = "Are you sure you want to delete selected messages from <b>".$lang['pms_'.$mode]."</b>?";
$lang['pms_delete_confirm_all'] = "Are you sure you want to delete ALL messages from <b>".$lang['pms_'.$mode]."</b>?";
$lang['pms_new'] = "New message";
$lang['pms_select_user'] = "Select a user";
$lang['pms_sent_success'] = "The message was send successfully";
$lang['pms_redirect'] = "Please wait a moment";
$lang['pms_empty'] = "No messages in this folder";
$lang['pms_reply'] = "Reply";
$lang['pms_view'] = "View message";
$lang['pms_mark'] = "Mark";
$lang['pms_edit'] = "Edit";
$lang['pms_subject'] = "Subject";
$lang['pms_message'] = "Message";
$lang['pms_to'] = "Recipient";
$lang['pms_date'] = "Date";
$lang['pms_send'] = "Send";
$lang['pms_preview'] = "Preview";
$lang['pms_status'] = "Status";
$lang['pms_from'] = "Sender";
$lang['pms_html'] = "Anable HTML in this message";
$lang['pms_bbcode'] = "Anable BBCode in this message";
$lang['pms_perpage'] = "Messages per page";
$lang['pms_user_pm'] = "PM";
$lang['pms_user_pm_alt'] = "PM to this user";
$lang['pms_total'] = "Total messages";
$lang['pms_received'] = "Received";
$lang['pms_quote'] = "Quote";
$lang['pms_error_save'] = "Error saving message. (the message could has been received)";
$lang['pms_error_notfound'] = "Can't find message.";
$lang['pms_paging_stats'] = "You have {total_cat_images} message(s) {new} on {total_pages} page(s) in your {box}.<br />Displayed: massage {first_page} to {last_page}.";
$lang['pms_email'] = "Notify by email on new Private Message";
$lang['pms_popup'] = "Pop up window on new Private Message";
$lang['pms_popup_confirm'] = "You have a new private message. Click OK to view it, or cancel to hide this prompt.";
$lang['pms_popup_newwindow'] = "Open in new window?\\n\\n(Press cancel to open your Inbox in the current window.)";
$lang['pms_email_new'] = "New private message";


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

After this step the main installation is complete. :wink: :D
U can check it by going to: http://YOURSITE/4images/pms.php


Step 5. Updated 5-03-2003 2pm (EST)
Open /includes/page_header.php
Find:
Code: [Select]
$site_template->register_vars(array(
  "media_url" => MEDIA_PATH,
Replace with:
Code: [Select]
//-----------------------------------------------------
//--- PMS ---------------------------------------------
//-----------------------------------------------------
$sql = "SELECT COUNT(pms_id) AS total
FROM ".PMS_TABLE."
WHERE pms_to = ".$user_info['user_id']." AND (pms_type = ".PMS_SENT." OR pms_type = ".PMS_SDLT." OR pms_type = ".PMS_UNREAD.")";
$result = $site_db->query_firstrow($sql);
$pms_inbox = $result['total'];
$sql = "SELECT COUNT(pms_id) AS total
FROM ".PMS_TABLE."
WHERE pms_from = ".$user_info['user_id']." AND pms_type = ".PMS_UNREAD;
$result = $site_db->query_firstrow($sql);
$pms_outbox = $result['total'];
$sql = "SELECT COUNT(pms_id) AS total
FROM ".PMS_TABLE."
WHERE pms_from = ".$user_info['user_id']." AND (pms_type = ".PMS_SENT." OR pms_type = ".PMS_RDLT.")";
$result = $site_db->query_firstrow($sql);
$pms_sentbox = $result['total'];
$sql = "SELECT COUNT(pms_id) AS new
FROM ".PMS_TABLE."
WHERE pms_to = ".$user_info['user_id']." AND pms_type = ".PMS_UNREAD;
$result = $site_db->query_firstrow($sql);
$pms_new = "<a href=\"".$site_sess->url(ROOT_PATH."pms.php")."\">".(($result['new']) ? "<blink>".$result['new']."</blink>" : 0)."</a>";
$pms = preg_replace("/".$site_template->start."msg_new_count".$site_template->end."/siU", $pms_new, $lang['pms_link']);
$pms = preg_replace("/".$site_template->start."inbox".$site_template->end."/siU", "<a href=\"".$site_sess->url(ROOT_PATH."pms.php")."\">".$lang['pms_inbox']."</a>", $pms);
// PMS Boxes
$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 = ($result['new']) ? $blink."<span id=\"blnk\">".$lang['pms_inbox']."</span><script language=\"JavaScript\">blink();</script>" : $lang['pms_inbox'];
$inbox = "<a href=\"".$site_sess->url(ROOT_PATH."pms.php?action=inbox")."\" title=\"".$lang['pms_total']." (".$pms_inbox.")\">".$show_inbox."</a>";
$sentbox = "<a href=\"".$site_sess->url(ROOT_PATH."pms.php?action=sentbox")."\" title=\"".$lang['pms_total']." (".$pms_sentbox.")\">".$lang['pms_sentbox']."</a>";
$outbox = "<a href=\"".$site_sess->url(ROOT_PATH."pms.php?action=outbox")."\" title=\"".$lang['pms_total']." (".$pms_outbox.")\">".$lang['pms_outbox']."</a>";
$newpms = "<a href=\"".$site_sess->url(ROOT_PATH."pms.php?action=new")."\">".$lang['pms_new']."</a>";

$sql = "SELECT pms_date
FROM ".PMS_TABLE."
WHERE pms_to = ".$user_info['user_id']." AND pms_type = ".PMS_UNREAD."
ORDER BY pms_date DESC";
$result = $site_db->query_firstrow($sql);
$pms_popup_script = "";
$pms_popup_header = "";
if ($result && $user_info['user_pms_popup'] && !ereg("pms.php", $self_url)) {
$cookie_name = (defined("COOKIE_NAME")) ? COOKIE_NAME : "4images_";
$cookie_pmsnewpopup = isset($HTTP_COOKIE_VARS[$cookie_name.'pmsnewpopup']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookie_name.'pmsnewpopup'])) : 0;
$pmsnewpopup = (isset($session_info['pmsnewpopup'])) ? $session_info['pmsnewpopup'] : $cookie_pmsnewpopup;
if ($pmsnewpopup < $result['pms_date']) {
$cookie_expire = time() + 60 * 60 * 24 * 90;
setcookie($cookie_name.'pmsnewpopup', serialize($result['pms_date']), $cookie_expire, COOKIE_PATH, COOKIE_DOMAIN, COOKIE_SECURE);
$site_sess->set_session_var("pmsnewpopup", $result['pms_date']);
$pms_popup_script = "<script language=\"JavaScript\">
<!--
function confirm_newpm() {
input_box=confirm('".$lang['pms_popup_confirm']."');
if (input_box==true) { // Output when OK is clicked
second_box=confirm('".$lang['pms_popup_newwindow']."');
if (second_box==true) {
window.open('".$site_sess->url(ROOT_PATH."pms.php")."','pmnew','width=600,height=500,menubar=yes,scrollbars=yes,toolbar=yes,location=yes,directories=yes,resizable=yes,top=50,left=50');
} else {
window.location='".$site_sess->url(ROOT_PATH."pms.php")."';
}
} else {
// Output when Cancel is clicked
}
}
// -->
</script>";
$pms_popup_header = "onload=\"Javascript:confirm_newpm()\"";
}
}

$site_template->register_vars(array(
"pms_boxes" => ($user_info['user_level'] < USER) ? "" : $inbox."&nbsp;&nbsp;|&nbsp;&nbsp;".$sentbox."&nbsp;&nbsp;|&nbsp;&nbsp;".$outbox."&nbsp;&nbsp;|&nbsp;&nbsp;".$newpms,
"pms_popup_script" => $pms_popup_script,
"pms_popup_header" => $pms_popup_header,
  "media_url" => MEDIA_PATH,


Step 6.
Edit templates where u want to show folders links.
Use those tags:
{pms_boxes}  - this will show folders
{pms} - this will show "You have 2  new images in Inbox"


Step 7.
Open /member.php
Find:
Code: [Select]
   $site_template->register_vars(array(
      "user_id" => $user_row['user_id'],
      "user_name" => (isset($user_row['user_name'])) ? htmlspecialchars($user_row['user_name']) : REPLACE_EMPTY,
Add after:
Code: [Select]
    "lang_pm" => ($user_info['user_id'] != $user_row['user_id']) ? "<a href=\"".$site_sess->url(ROOT_PATH."pms.php?action=reply&user_id=".$user_row['user_id'])."\" alt=\"".$lang['pms_user_pm_alt']."\">".$lang['pms_user_pm']."</a>" : "",

Step 8. Updated 05-21-03
Open /details.php
Find:
Code: [Select]
       "comment_id" => $comment_row[$i]['comment_id'],Add after:
Code: [Select]
"lang_pm" => ($user_info['user_id'] != $comment_row[$i]['user_id'] && $user_info['user_level'] >= USER && $comment_row[$i]['user_id'] >= USER) ? "<a href=\"".$site_sess->url(ROOT_PATH."pms.php?action=reply&user_id=".$comment_row[$i]['user_id'])."\" alt=\"".$lang['pms_user_pm_alt']."\">".$lang['pms_user_pm']."</a>" : "",

Step 9.
Open:
/templates/<yourtemplate>/member_profile.html
/templates/<yourtemplate>/comment_bit.html

Use this tag to show link to PM the user:
{lang_pm}


Step 10. new added  05-03-2003 2pm (EST)
Open /includes/db_field_definitions.php
At the end of the file, just before closing ?> add this:
Code: [Select]
$additional_user_fields['user_pms_email'] = array($lang['pms_email'], "radio", 0);
$additional_user_fields['user_pms_popup'] = array($lang['pms_popup'], "radio", 0);


Step 11. new added  05-03-2003 2pm (EST)
Open /templates/<yourtemplate>/member_editprofile.html
Add this:
Code: [Select]
         <tr>
            <td class="row2"><b>{lang_user_pms_email}</b></td>
            <td class="row2">
              <input type="radio" name="user_pms_email" value="1"{user_pms_email_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_pms_email" value="0"{user_pms_email_no} />
              {lang_no}
            </td>
          </tr>
          <tr>
            <td class="row1"><b>{lang_user_pms_popup}</b></td>
            <td class="row1">
              <input type="radio" name="user_pms_popup" value="1"{user_pms_popup_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_pms_popup" value="0"{user_pms_popup_no} />
              {lang_no}
            </td>
          </tr>


Step 12. new added  05-03-2003 2pm (EST)
Open /templates/<yourtemplate>/header.html
1. in between <head> and </head> add this:
{pms_popup_script}

2. inside <body> tag add {pms_popup_header}
Should looks like this: <body {pms_popup_header}



-----------| Note |-----------------------------

All templates where created for my site design, and just little bit adopted for default teplate. Because of that some colors ar missing - that's your work now ;).

Also, I didnt remove one, might be useful, feature - different color for "success" messages and "warning/error".

If u wish use it, here what u need to do:
create two new classes in style.css for examle:
Quote
.msg0 {
  background-color: #FFCECE;
  color: #2F6B9D;
}
.msg1 {
  background-color: #CEFFDD;
  color: #2F6B9D;
}
then use something like this in the pms.html template:
class="msg{msg_color}"
Title: [MOD] Private Message System (PMS)
Post by: SLL on April 30, 2003, 10:50:56 PM
vano, osobenno udalos' nazvanie  :lol:  :lol:  :lol:
Title: [MOD] Private Message System (PMS)
Post by: V@no on April 30, 2003, 11:04:51 PM
aga, no ne moya ideya. :D
Title: [MOD] Private Message System (PMS)
Post by: Bomba on May 01, 2003, 12:17:40 AM
didn't insert this mod yet, but if this thing works... its AWESOME!!!!!!!

it would be cool if every comment made to user images would be forward to his inbox


GREAT MOD!!!
Title: Runtime Error ( Line 218 )
Post by: jackie911 on May 01, 2003, 08:49:21 AM
I had follow the instruction to install PMS to my 4images system.  Unfortunately, there was a problem occured.

Please help me to solve it.

Jackie
bid@jackie.net

--> http://album.barndisco.com/pms.php?action=new
Title: Re: Runtime Error ( Line 218 )
Post by: V@no on May 01, 2003, 09:58:06 AM
Quote from: jackie911
I had follow the instruction to install PMS to my 4images system.  Unfortunately, there was a problem occured.

Please help me to solve it.

Agree with Cr@zy Sash ;)
if u where talking about JavaScript error, and that most of BBCode buttons dont work, I fixed it, just download the package again, and replace pms.php and pms_new.html files.
Title: Re: Runtime Error ( Line 218 )
Post by: jackie911 on May 01, 2003, 10:05:18 AM
If you click into the message box, it will pop-up the message box say error.

Can you fix it??

 :cry:

Quote from: V@no
Quote from: jackie911
I had follow the instruction to install PMS to my 4images system.  Unfortunately, there was a problem occured.

Please help me to solve it.

Agree with Cr@zy Sash ;)
if u where talking about JavaScript error, and that most of BBCode buttons dont work, I fixed it, just download the package again, and replace pms.php and pms_new.html files.
Title: [MOD] Private Message System (PMS)
Post by: V@no on May 01, 2003, 10:13:18 AM
did u redownload the package?
btw, I dont see any error messages when I click into the message box.
only when I click on "B", "I" or "U" buttons. But that I fixed in the updated package.

P.S. u might want first delete internet cache, before u download package again.

[EDITED] ah, yes, u where right, it showed error message on text area click...that's because I use different BBCode editor at my site...
Fixed that too.
Title: Still not work.....
Post by: jackie911 on May 01, 2003, 10:37:42 AM
I'm using IE 5.0, I still not work normal to the PMS.
Can you e-mail pms.php & pms_new.html to me.

Jackie
jackie911@so-net.com.hk

Thanks a lot.

Quote from: V@no
did u redownload the package?
btw, I dont see any error messages when I click into the message box.
only when I click on "B", "I" or "U" buttons. But that I fixed in the updated package.

P.S. u might want first delete internet cache, before u download package again.

[EDITED] ah, yes, u where right, it showed error message on text area click...that's because I use different BBCode editor at my site...
Fixed that too.
Title: Thanks...............It's Work.
Post by: jackie911 on May 01, 2003, 10:51:32 AM
Quote from: jackie911
I'm using IE 5.0, I still not work normal to the PMS.
Can you e-mail pms.php & pms_new.html to me.

Jackie
jackie911@so-net.com.hk

Thanks a lot.

Quote from: V@no
did u redownload the package?
btw, I dont see any error messages when I click into the message box.
only when I click on "B", "I" or "U" buttons. But that I fixed in the updated package.

P.S. u might want first delete internet cache, before u download package again.

[EDITED] ah, yes, u where right, it showed error message on text area click...that's because I use different BBCode editor at my site...
Fixed that too.
Title: Can I make a Group Mail ??
Post by: jackie911 on May 01, 2003, 07:31:30 PM
Can I make a Group Mail ??
Title: Re: Can I make a Group Mail ??
Post by: V@no on May 01, 2003, 07:41:25 PM
Quote from: jackie911
Can I make a Group Mail ??

hum?  :?
Title: Re: Can I make a Group Mail ??
Post by: jackie911 on May 01, 2003, 07:50:28 PM
Is is possible to do it??

Quote from: V@no
Quote from: jackie911
Can I make a Group Mail ??

hum?  :?
Title: [MOD] Private Message System (PMS)
Post by: V@no on May 01, 2003, 07:53:58 PM
yes, but I didnt want do it, because its a good way for spamming. 8)
Title: Any information about this??
Post by: jackie911 on May 01, 2003, 08:09:37 PM
Any information about this MOD??

Quote from: V@no
yes, but I didnt want do it, because its a good way for spamming. 8)
Title: [MOD] Private Message System (PMS)
Post by: V@no on May 01, 2003, 08:48:25 PM
Found little bug (already updated the package)
when u edit messages in the Outbox, it wouldnt update recipent if u change it.
so, in pms.php find:
Code: [Select]
           SET pms_date = $time, pms_subject = '$subject', pms_text = '$message', pms_bbcode = $bbcode, pms_html = $html, pms_ip = '".$session_info['session_ip']."'
Replace with:
Code: [Select]
           SET pms_date = $time, pms_to = $user_id, pms_subject = '$subject', pms_text = '$message', pms_bbcode = $bbcode, pms_html = $html, pms_ip = '".$session_info['session_ip']."'
Title: [MOD] Private Message System (PMS)
Post by: V@no on May 01, 2003, 10:59:53 PM
Quote from: Cr@zy Sash
no i mean just a admin function maybe put as plugin in admin panel...

Great idea!

here u go the plugin:

Update 05-04-2003 8pm (EST)

---------| Installation |----------------

Create /admin/plugins/pms_to_members.php
with this code:
Code: [Select]
<?php // PLUGIN_TITLE&#58; Send PMs to members

$nozip 1;
define&#40;'IN_CP', 1&#41;;
$root_path = &#40;eregi&#40;"\/plugins\/", $PHP_SELF&#41;&#41; ? "./../../" &#58; "./../";
define&#40;'ROOT_PATH', $root_path&#41;;
require&#40;ROOT_PATH.'admin/admin_global.php'&#41;;
if &#40;$action == ""&#41; &#123;
  
$action "pmsusers";
&
#125;

show_admin_header&#40;&#41;;

if &#40;$action == "sendpms"&#41; &#123;
  
$error = array&#40;&#41;;
  
$stealth = &#40;$HTTP_POST_VARS['stealth'&#93;&#41; ? 1 &#58; 0;
  
$subject stripslashes&#40;trim&#40;$HTTP_POST_VARS['subject'&#93;&#41;&#41;;
  
$message stripslashes&#40;trim&#40;$HTTP_POST_VARS['message'&#93;&#41;&#41;;

  
if &#40;$subject == ""&#41; &#123;
    
$error['subject'&#93; = 1;
  
&#125;
  
if &#40;$message == ""&#41; &#123;
    
$error['message'&#93; = 1;
  
&#125;
  
if &#40;!isset&#40;$HTTP_POST_VARS['pms'&#93;&#41; || empty&#40;$HTTP_POST_VARS['pms'&#93;&#41;&#41; &#123;
    
$error['pms'&#93; = 1;
  
&#125;
  
if &#40;empty&#40;$error&#41;&#41; &#123;
    
$pms $HTTP_POST_VARS['pms'&#93;;
include&#40;ROOT_PATH.'includes/email.php'&#41;;
foreach &#40;$pms as $key&#41; &#123;
if &#40;$key&#41; &#123;
$sql "INSERT INTO ".PMS_TABLE."
&#40;pms_date, pms_to, pms_from, pms_subject, pms_type, pms_text, pms_bbcode, pms_html, pms_ip&#41;
VALUES
&#40;"
.time&#40;&#41;.", ".$key.", ".&#40;&#40;$stealth&#41; ? 0 &#58; $user_info['user_id'&#93;&#41;.", '".$subject."', ".PMS_UNREAD.", '".$message."', 1, 1, '0'&#41;";
$result $site_db->query&#40;$sql&#41;;
$result_error = &#40;$result&#41; ? $result_error &#58; $result_error++;
$user_to get_user_info&#40;$key&#41;;
if &#40;$user_to['user_pms_email'&#93;&#41;&#123;
     @set_time_limit&#40;1200&#41;;
$site_email = new Email&#40;&#41;;
// $pms_url = "http&#58;//come.no-ip.com/pms.php?action=view&mode=inbox&id=".$site_db->get_insert_id&#40;&#41;;
$pms_url $script_url."/pms.php?action=view&mode=inbox&id=".$site_db->get_insert_id&#40;&#41;;
$site_email->set_to&#40;$user_to['user_email'&#93;&#41;;
$site_email->set_subject&#40;$lang['pms_email_new'&#93;&#41;;
$site_email->register_vars&#40;array&#40;
  "user_name" => $user_to['user_name'&#93;,
//   "site_url" => "http&#58;//come.no-ip.com",
  "site_url" => $script_url,
  "url" => $pms_url,
  "site_name" => $config['site_name'&#93;
&#41;&#41;;
$site_email->set_body&#40;"pms_notify", $config['language_dir_default'&#93;&#41;;
$site_email->send_email&#40;&#41;;
&#125;
&#125;
&#125;
    
echo &#40;!$result_error&#41; ? "Messages sent successfully" &#58; "Error sending messages";
    
echo "<p>";
    
show_text_link&#40;$lang['back'&#93;, "javascript&#58;history.back&#40;1&#41;"&#41;;
  
&#125;
  
else &#123;
    
$msg sprintf&#40;"<span class=\"marktext\">%s</span>", $lang['lostfield_error'&#93;&#41;;
    
$action "pmsusers";
  &
#125;
&#125;

if &#40;$action == "pmsusers"&#41; &#123;
  
if &#40;$msg != ""&#41; &#123;
    
printf&#40;"<b>%s</b>\n", $msg&#41;;
  
&#125;
  
show_form_header&#40;"pms_to_members.php", "sendpms"&#41;;
  
show_table_header&#40;"Send PMs", 2&#41;;
  
show_input_row&#40;"Subject", "subject", "", 45&#41;;
  
show_textarea_row&#40;"Message", "message", "", 60, 20&#41;;

  
$select "<select name=\"pms[&#93;\" size=\"15\" multiple=\"multiple\">\n";

  
$sql "SELECT ".get_user_table_field&#40;"", "user_id"&#41;.get_user_table_field&#40;", ", "user_level"&#41;.get_user_table_field&#40;", ", "user_name"&#41;."
          
FROM ".USERS_TABLE."
          
WHERE ".get_user_table_field&#40;"", "user_id"&#41;." <> ".GUEST." AND ".get_user_table_field&#40;"", "user_id"&#41;." <> ".$user_info['user_id'&#93;."
          
ORDER BY ".get_user_table_field&#40;"", "user_level"&#41;." DESC".get_user_table_field&#40;"", "user_name"&#41;." ASC";
  
$result = $site_db->query&#40;$sql&#41;;

  
$level = 1000;
  while &#40;
$row = $site_db->fetch_array&#40;$result&#41;&#41; &#123;
    
$user_level = $row[$user_table_fields['user_level'&#93;&#93;;
    if &#40;
$level != $user_level && $user_level == ADMIN&#41; &#123;
      
$select .= "<option value=\"0\">__________________________</option>\n";
      
$select .= "<option value=\"0\" class=\"dropdownmarker\">".$lang['userlevel_admin'&#93;."</option>\n";
    
&#125;
    
elseif &#40;$level != $user_level && $user_level == USER&#41; &#123;
      
$select .= "<option value=\"0\">__________________________</option>\n";
      
$select .= "<option value=\"0\" class=\"dropdownmarker\">".$lang['userlevel_registered'&#93;."</option>\n";
    
&#125;
    
elseif &#40;$level != $user_level && $user_level == USER_AWAITING&#41; &#123;
      
$select .= "<option value=\"0\">__________________________</option>\n";
      
$select .= "<option value=\"0\" class=\"dropdownmarker\">".$lang['userlevel_registered_awaiting'&#93;."</option>\n";
    
&#125;
    
$user_id $row[$user_table_fields['user_id'&#93;&#93;;
    
$user_name $row[$user_table_fields['user_name'&#93;&#93;;
    
$selected = &#40;isset&#40;$HTTP_POST_VARS['pms'&#93;&#41; && !in_array&#40;$user_id, $HTTP_POST_VARS['pms'&#93;&#41;&#41; ? "" &#58; " selected=\"selected\"";
    
$select .= "<option value=\"".$user_id."\"".$selected.">&raquo; ".$user_name."</option>\n";
    
$level $user_level;
  &
#125;
  
$select .= "</select>\n";

  
$title $lang['select_email_user'&#93;;
  
if &#40;isset&#40;$error['pms'&#93;&#41;&#41; &#123;
    
$title sprintf&#40;"<span class=\"marktext\">%s *</span>", $title&#41;;
  
&#125;
  
$stealth = &#40;isset&#40;$HTTP_POST_VARS['stealth'&#93;&#41;&#41; ? " checked" &#58; "";
  
show_custom_row&#40;$title, $select&#41;;
  
show_custom_row&#40;"", "<input type=\"checkbox\" name=\"stealth\" value=\"1\"".$stealth."> Stealth mode. If u check this, member wont know from who the message came"&#41;;
  
show_form_footer&#40;"Send", "", 2&#41;;
&#125;

show_admin_footer&#40;&#41;;
?>



if u did everything correctly, u'll find new link at the left-bottom in the Admin Control Panel.


If u already installed the MOD and whant use "Stealth" mode, u'll need do small correction in the MOD (I have updated the original MOD):

in pms.php find:
Code: [Select]
$user_id = $result['pms_from'];
$reply = 1;

Replace with:
Code: [Select]
$user_id = ($result['pms_from']) ? $result['pms_from'] : 0;
$reply = ($user_id) ? 1 : 0;
Title: Great !!
Post by: jackie911 on May 02, 2003, 03:15:05 AM
Great Thanks to ALL.

 :lol:
Title: [MOD] Private Message System (PMS)
Post by: O.K. on May 03, 2003, 07:22:06 PM
I think it would be great to send e-mail notification to user which received private message. And the other thing is pop-up window, when user logins, if she / he has got a new private message. :)
Title: [MOD] Private Message System (PMS)
Post by: V@no on May 03, 2003, 08:20:02 PM
yes, I just updated the original post.
U will need redo almost all steps :(
even run pms_install.php script one time (if u see some errors about tables dublication, just ignore them)
also, the plugin was updated too.
Title: [MOD] Private Message System (PMS)
Post by: matthew on May 04, 2003, 04:05:18 AM
So far some things seem to be working. I already had a phpbb forum and its displaying when I have message there in the popup. However when I try to click on the PM field in the comment section or profile, I get the following:

Fatal error: Call to undefined function: get_smiles_text() in /home/test/public_html/pms.php on line 222

Any ideas?
Title: [MOD] Private Message System (PMS)
Post by: V@no on May 04, 2003, 04:22:07 AM
ops...
either redownload the package and replace your pms.php
or open pms.php find:
Code: [Select]
     "smiles_text" => get_smiles_text()delete it, and also delete coma ( , ) at the end of line above that one.
Title: [MOD] Private Message System (PMS)
Post by: matthew on May 04, 2003, 04:48:30 AM
Thanks V@no, works great!
Title: [MOD] Private Message System (PMS)
Post by: Bomba on May 05, 2003, 12:11:45 AM
and what about the picture comments, can they be forward to picture owner inbox?
i think it would be really cool :)
Title: [MOD] Private Message System (PMS)
Post by: V@no on May 05, 2003, 12:59:55 AM
Quote from: Bomba
and what about the picture comments, can they be forward to picture owner inbox?
i think it would be really cool :)

and what do want to do with comments posted by guests?
Title: [MOD] Private Message System (PMS)
Post by: Bomba on May 05, 2003, 01:40:53 AM
in my gallery, guests are not allowed to comment
only registed members can
Title: [MOD] Private Message System (PMS)
Post by: V@no on May 05, 2003, 02:05:08 AM
Fixed little bug, that didnt sort correctly messages by recipient/sender name.
in pms.php find:
Code: [Select]
$order_by = "pms_".$sort." ".$sort_order.", pms_".$sort_default." ".$sort_order;Replace with:
Code: [Select]
$order_by = (($sort == $box_table) ? "u.user_name" : "pms_".$sort)." ".$sort_order.", pms_".$sort_default." ".$sort_order;
Title: Runtime Error
Post by: jackie911 on May 05, 2003, 06:05:13 PM
I used the smile text for bbcode.  Unfortunately, there are some errors.
I'm not an expert, please help me to debug it.

http://jackie.net/barndisco.com/album/pms.php?action=new

Jackie
jackie911@so-net.com.hk
Title: Re: Runtime Error
Post by: V@no on May 05, 2003, 06:24:01 PM
Quote from: jackie911
I used the smile text for bbcode.  Unfortunately, there are some errors.
I'm not an expert, please help me to debug it.


Nothing personaly, but next time I wont even click :roll:


I'm not sure what u did, but I have tryed your site yesterday and it was working perfectly!
Title: Re: Runtime Error
Post by: jackie911 on May 05, 2003, 07:57:33 PM
Where can I insert this code to pms.php

Code: [Select]
"smiles_text" => get_smiles_text()


Quote from: V@no
Quote from: jackie911
I used the smile text for bbcode.  Unfortunately, there are some errors.
I'm not an expert, please help me to debug it.


Nothing personaly, but next time I wont even click :roll:


I'm not sure what u did, but I have tryed your site yesterday and it was working perfectly!
Title: Re: Runtime Error
Post by: V@no on May 05, 2003, 08:05:56 PM
Quote from: jackie911
Where can I insert this code to pms.php


find:
Quote
     "lang_list_item_prompt" => $lang['list_item_prompt']

Replace with:
Quote
     "lang_list_item_prompt" => $lang['list_item_prompt'],
      "smiles_text" => get_smiles_text()
Title: [MOD] Private Message System (PMS)
Post by: LoOpP on May 05, 2003, 08:06:14 PM
I get this error plz help

Code: [Select]
DB Error: Bad SQL Query: SELECT COUNT(pms_id) AS total FROM 4images_pms WHERE pms_to = 1 AND (pms_type = 2 OR pms_type = 1 OR pms_type = 3)
Table 'v15168.4images_pms' doesn't exist

DB Error: Bad SQL Query: SELECT COUNT(pms_id) AS total FROM 4images_pms WHERE pms_from = 1 AND pms_type = 3
Table 'v15168.4images_pms' doesn't exist

DB Error: Bad SQL Query: SELECT COUNT(pms_id) AS total FROM 4images_pms WHERE pms_from = 1 AND (pms_type = 2 OR pms_type = 0)
Table 'v15168.4images_pms' doesn't exist

DB Error: Bad SQL Query: SELECT COUNT(pms_id) AS new FROM 4images_pms WHERE pms_to = 1 AND pms_type = 3
Table 'v15168.4images_pms' doesn't exist

DB Error: Bad SQL Query: SELECT pms_date FROM 4images_pms WHERE pms_to = 1 AND pms_type = 3 ORDER BY pms_date DESC
Table 'v15168.4images_pms' doesn't exist



or see it at my hp http://www.fos-spion.de/4images1.7/4images/
Title: [MOD] Private Message System (PMS)
Post by: V@no on May 05, 2003, 08:09:48 PM
did u do step 4.?
Title: [MOD] Private Message System (PMS)
Post by: LoOpP on May 05, 2003, 09:12:08 PM
den vierten schritt hab ich gemacht und das script hat auch angezeigt dass die installation correct verlaufen ist, nachem ich aber die pms. php aufgerufen habe kam dieser error[/u]
Title: [MOD] Private Message System (PMS)
Post by: LoOpP on May 05, 2003, 09:44:10 PM
vielleicht liegt das Problem daran das ich folgenden Code in der member.php nicht finde.

Code: [Select]
$site_template->register_vars(array(
      "user_id" => $user_row['user_id'],
      "user_name" => (isset($user_row['user_name'])) ? htmlspecialchars($user_row['user_name']) : REPLACE_EMPTY,


anstatt dieses codes hab ich bei mir nur folgenden gefunden

Code: [Select]
$site_template->register_vars(array(
        "user_id" => $user_row['user_id'],
        "user_name" => htmlspecialchars($user_row['user_name']),


und den neuen darunter geschrieben!
Title: [MOD] Private Message System (PMS)
Post by: LoOpP on May 05, 2003, 09:53:21 PM
da steht nichts von erstetzen in step 7

is nur komisch das der codein meiner member.php anders aussieht

für eure Hilfe wär ich sehr dankbar

thx tobi
Title: [MOD] Private Message System (PMS)
Post by: LoOpP on May 06, 2003, 02:16:01 PM
hat funktioniert 1000 danke
Title: [MOD] Private Message System (PMS)
Post by: hoelzlmani on May 06, 2003, 02:57:24 PM
ich hab mir das neue package nochmals runtergeladen und frisch installiert, nur wenn ich jetzt auf die pm gehe, dann sieht das design plötzlich scheisse aus. hab 3x am bildschirm das feld mit registrierter user, darunter ein minibild, in der mitte selbst ist dann die pn.

ein 2. problem. ich bekomme keine benachrichtigungsmail wenn eine neue pn angekommen ist. die funktion ist aber aktiviert worden.

der rest läuft bestens  :D
Title: [MOD] Private Message System (PMS)
Post by: LoOpP on May 07, 2003, 07:28:49 PM
es gibt noch ein problem

wenn ich eine neue nachricht schreiben will wird auf im browser ein fehler angezeigt

und die meisten BBCode optionen gehen nicht, d.h. es öffnen sich keine fenster

danke für Hilfe
Title: Prob mit den templates
Post by: Gabi on May 08, 2003, 10:25:29 AM
Quote from: Cr@zy Sash
well maybe it's better 2 say what your problem is...:lol:

By the way thanks 4 that

Quote from: V@no
------------------------------------------------
This MOD originaly was created by Cr@zy Sash, but after I tryed to troubleshooting it, I got an idea how to make it more advanced and using only one entry in the database for each message instead of doublicating for each folder.
Still 51% of credit goes to Cr@zy Sash ;) :D
------------------------------------------------


Hy Crazy Sasch,

danke für dieses geniale Mod,

es ergeben sich aber mehrere Probleme.  :oops:  Bitte logge dich doch mal kurz in meine HP ein, denn ich kann das Prob nicht genau erklären. In der Gallerie habe ich die beiden Tags eingesetz und wenn ich alles richtig verstanden habe sollen sich die Inbox etc. in einem popup öffnen...tut es nicht auch beim scheiben einer neuen Nachricht funz nicht alles aber das zu erklären ist zu heftig.... mein URL http://www.foto-place.de
 
Zugangsdaten für dich:

Benutzername: Test
Passwort: Test

Habe alles durgesehen und keinen Fehler gefunden..

lg

Gabi
Title: Re: Prob mit den templates
Post by: Gabi on May 08, 2003, 12:34:16 PM
Quote from: Gabi
Quote from: Cr@zy Sash
well maybe it's better 2 say what your problem is...:lol:

By the way thanks 4 that

Quote from: V@no
------------------------------------------------
This MOD originaly was created by Cr@zy Sash, but after I tryed to troubleshooting it, I got an idea how to make it more advanced and using only one entry in the database for each message instead of doublicating for each folder.
Still 51% of credit goes to Cr@zy Sash ;) :D
------------------------------------------------


Hy Crazy Sasch,

danke für dieses geniale Mod,

es ergeben sich aber mehrere Probleme.  :oops:  Bitte logge dich doch mal kurz in meine HP ein, denn ich kann das Prob nicht genau erklären. In der Gallerie habe ich die beiden Tags eingesetz und wenn ich alles richtig verstanden habe sollen sich die Inbox etc. in einem popup öffnen...tut es nicht auch beim scheiben einer neuen Nachricht funz nicht alles aber das zu erklären ist zu heftig.... mein URL http://www.foto-place.de
 
Zugangsdaten für dich:

Benutzername: Test
Passwort: Test

Habe alles durgesehen und keinen Fehler gefunden..

lg

Gabi


Hy also das erste Prob habe ich gerade beseitigt bekommen...peinlich :oops:  Musste natürlich das pms.html erst noch an meines anpassen....ich Schussel....
Nur ein Prob besteht noch...und zwar in der Userauswahl Box erscheinen keine Namen ist komplett weiß nur der default Text wird angezeigt "selekt a user" danach kommt nur noch weiß......

Noch eine 2 Frage da ich phpbb in meine Page includet habe kommen die user ja nicht auf die 4images member.php sondern ins Forum als "Normalzustand" müsste also das empangen und senden von pms eingestellt sein bei allen usern. Ist dies so ???? Denn sonst würde sich der "leere" Mitgliederramen schon erklären :?:

Grüße

Gabi
Title: Re: German Language Pack 4 PMS
Post by: Gabi on May 08, 2003, 03:01:30 PM
Hy Crazy,

du hast einen kleinen Fehler in der lang Datei und zwar :
$lang['pms_sentbox'] = "Posteingang"; müsste POSTAUSGANG heissen.

ups und noch einen

$lang['pms_popup_confirm'] = "Du hast eine neue Nachricht. Drücke OK um die NAchricht zu sehen oder Abbrechen um diese BEnachrichtigung zu schließen.";


lg
Gabi
Title: @ Sascha
Post by: LoOpP on May 08, 2003, 05:01:48 PM
hier die URL zum BBcode Fehler

http://www.fos-spion.de/4images1.7/4images/pms.php?action=new
Login:
Ben: Test
PW: Test

versuch die button zu drücken udn klick mit der maus in das textfeld
dann siehst du auch unten im browser den Fehler

Danke
Title: [MOD] Private Message System (PMS)
Post by: Gabi on May 08, 2003, 07:53:37 PM
Quote from: Cr@zy Sash
jo danke Gabi aber dazu musst du nicht nocheinmal den ganzen Code posten. Nimm den bitte aus deinbem Beitrag danke..


Schon erledigt  :D
Sag konntest Du schon was raus bekommen warum das Skript bei mir net richtig funzt ?
Title: [MOD] Private Message System (PMS)
Post by: V@no on May 08, 2003, 09:19:03 PM
Quote from: heiko
Hi V@no

Thank you very much for working out this nice  mod.


Everythink works fine but there is one thing left i need assistance for:


1)

If you are in view mode of a private mail you´ll find 2 buttons
answer & delete message.

When trying to delete a message in view mode first  a message comes up asking if i am sure to delelte the mesasge...(yes/no option)....ok...but after pressing yes for confirmation i got a page not found error...

crazy but in inbox mod everything works fine....


2.) How can i redirect to another page after using the logout function when on pms page ???... i always got the message screen ....(after logging of from pms menu...you have to be logged in.....)


Thanks for help...!


Heiko



1.) I'm not sure why is that...works fine for me. maybe try to clear your interenet cache? cookies? if wont help, maybe u can give me the link so I can check it out?

2.) yes, sure, thx for the note! I will add one more step to fix this.
but for now, open logout.php
Find:
Code: [Select]
if (!ereg("index.php", $url)(this is just a part of long line ;)
then add after: && !ereg("pms.php", $url) so it should looks like this:
Code: [Select]
if (!ereg("index.php", $url) && !ereg("pms.php", $url)
again, remmber, this is only begining of the line ;) (I dont want post entire line, because my line is about double size of the original now :?
Title: [MOD] Private Message System (PMS)
Post by: LoOpP on May 09, 2003, 07:23:40 AM
nein, ich hab nur die große ein wenig verändert!
Title: [MOD] Private Message System (PMS)
Post by: Gabi on May 09, 2003, 04:16:44 PM
Ok i will try to explain my problem with this Mod in english :oops:  :oops:

I have installd the PMS Mod in my homepage everything seams to work but i can´t selekt a user. I think the problem is the inclusion from phpbb in my 4images homepage. The gallerie is now using user table fom the phpbord, so i think the skript cant read userstable. I build manuel the pms table in my forums table so the prefix is not 4images_pms it is now fotopl_pms what changes must i do in the script, that the pms.php can read user id etc. from forums table?

Code wieder rausgenommen !!!

Here is the pms.php meby somon can help me to fix this site. I hope somone could undarstand my problem...

lg
Gabi
Title: [MOD] Private Message System (PMS)
Post by: Gabi on May 09, 2003, 05:27:00 PM
Quote from: Cr@zy Sash
also ich würde mir das ja gerne nochmal anschauen, aber dazu musst du den TEstaccount wieder aktivieren, damit kannich mich nimma einloggen...


Hy Crazy,

hast ja recht..war n bissel viel  :oops: Der Account besteht aber noch
User: Test
PW: Test
Wichtig! Achte auf groß / kleinschreibung !!!!

lg
Gabi

Nachtrag:

Ich glaub ich werde irre !!!!! Ich habe mir gerade den Spaß gemacht und noch das ZusatzMOD Massen PM versenden installiert. Das funzt zu 100% absolut Fehlerfrei !!!!!
Ich gehe davon aus da ich ja das Mod mit dem "erweiterten bbcode verwende das der Text im Feld "user auswählen" einfach nur in weiß ist und ich deshalb keinen Namen sehe. Vom Adminbereich aus sind alle Namen sichtbar die angemeldet sind. Also funzt das Mod auch mit der Integration. Wo kann ich denn die Hintergrundfarbe von diesem Feld ändern ???? bzw. die Textfarbe ?????
Title: [MOD] Private Message System (PMS)
Post by: Gabi on May 10, 2003, 09:21:44 AM
Quote from: Cr@zy Sash
Also das kannst du in er pms_new.html anpassen, oder wie die Datei gleich heißt...


Hy Cr@zy Sash,

danke für den Tip. Habe mal dort nachgesehen. Ausgerechnet die (Userbox) ist ein javaskript. Habe keinen Plan wie ich was ändern kann. Wenn ich dir den Code der pms_new.html per e-mail zuschicke, wüdest du da vieleicht mal reinschauen ???
lg
Gabi
Title: [MOD] Private Message System (PMS)
Post by: Apollo13 on May 10, 2003, 11:46:46 AM
brauchst du nicht ich weiß wie der ausschaut hab ja mitgearbeitet am script... :lol:  :lol:

Öhm ja, also am besten fügst du dort einfach in the tag class="categoryselect" so und dann müsste das eigentlich gehen...
Title: [MOD] Private Message System (PMS)
Post by: Gabi on May 10, 2003, 12:00:24 PM
Öhm ja, also am besten fügst du dort einfach in the tag class="categoryselect" so und dann müsste das eigentlich gehen...[/quote]

Ja, ok....aber wo genau....ich habs an 2 Sellen ausprobiert und nix passiert  :oops:
Title: My last Chance :-(
Post by: Gabi on May 11, 2003, 02:13:19 PM
Inklusion of Mod works fine. Last Problem i have to fix is color of Useres in selectbox. in pms_new.html here are my changes in java skrip at the beginning of code. Everything works but ony the users i can´t see because bg colour is altways the same like text colour. Only default text is in FFFF00. Here are my changes in Java Script. Can someone please help me to fix it ???

Code: [Select]
<script language="JavaScript" src="bbcode2.js" type="text/javascript"class="categoryselect" style="color: #FFFF00"></script>
<script language="JavaScript"class="categoryselect" style="color: #FFFF00">
function emoticon2(text,space,area,popup) {
if (!proba) {
proba = document.commentform.comment_text;
}
emoticon2(text,space,area,popup);
}
</script>
<script language="JavaScript"class="categoryselect" style="color: #FFFF00">
var reply = "{reply}";
var user_list = "{user_list}";
var list = user_list.split(",");
var user_list = new Array();
var user_list_id = new Array();
var ii=0;
for (var i=0; i < (list.length/2); i++){
user_list[i] = list[ii+1];
user_list_id[i] = list[ii];
ii=ii+2;
}
function print_list(recipient){
if (reply != "") {
return reply+"<input type='hidden' name='user_id' class='categoryselect' style='color: #FFFF00'  value='"+recipient+"'>";
}
result="<select name='user_id' class='categoryselect' style='color: #FFFF00' >";
result +="<option value='0' class='categoryselect' style='color: #FFFF00'>{lang_select_user}</option>\n";
result +="<option value='0' class='categoryselect' style='color: #FFFF00'>---------------------------------------</option>\n";
for (var i=0; i<user_list_id.length; i++){
if (recipient == user_list_id[i]) {
mark = " selected='selected'";
}else{
mark = "";
}
result +="<option value='"+user_list_id[i]+"'"+mark+"class='categoryselect' style='color: #FFFF00' >"+user_list[i]+"</option>\n";
}
result +="</select>\n";
return result;
}
</script>


lg
Gabi
Title: Re: My last Chance :-(
Post by: V@no on May 11, 2003, 02:47:25 PM
Quote from: Gabi
Inklusion of Mod works fine. Last Problem i have to fix is color of Useres in selectbox. in pms_new.html here are my changes in java skrip at the beginning of code. Everything works but ony the users i can´t see because bg colour is altways the same like text colour. Only default text is in FFFF00. Here are my changes in Java Script. Can someone please help me to fix it ???

first delete all changes u made  style="color: #FFFF00"
then, open style.css and create new class, with background and text color settings, name it for example "categoryselect_users" and then change the class name in the code u showed ;)
Title: Re: My last Chance :-(
Post by: Gabi on May 11, 2003, 03:18:07 PM
Quote from: V@no
Quote from: Gabi

first delete all changes u made  style="color: #FFFF00"
then, open style.css and create new class, with background and text color settings, name it for example "categoryselect_users" and then change the class name in the code u showed ;)


THX V@no,
oki i have build an new claas change code, but there is same problem like bevore. only default text is in colour FFFFOO the users are bg colour black and text too. Did i forgot something to change ??? Here is my fixt code:

Code: [Select]
<script language="JavaScript">
var reply = "{reply}";
var user_list = "{user_list}";
var list = user_list.split(",");
var user_list = new Array();
var user_list_id = new Array();
var ii=0;
for (var i=0; i < (list.length/2); i++){
user_list[i] = list[ii+1];
user_list_id[i] = list[ii];
ii=ii+2;
}
function print_list(recipient){
if (reply != "") {
return reply+"<input type='hidden' name='user_id' class='categoryselect_users' value='"+recipient+"'>";
}
result="<select name='user_id' class='categoryselect_users'>";
result +="<option value='0' class='categoryselect_users'>{lang_select_user}</option>\n";
result +="<option value='0' class='categoryselect_users'>---------------------------------------</option>\n";
for (var i=0; i<user_list_id.length; i++){
if (recipient == user_list_id[i]) {
mark = " selected='selected'";
}else{
mark = "";
}
result +="<option value='"+user_list_id[i]+"'"+mark+"class='categoryselect_users'>"+user_list[i]+"</option>\n";
}
result +="</select>\n";
return result;
}
</script>


regrets from germany
Gabi
Title: [MOD] Private Message System (PMS)
Post by: V@no on May 11, 2003, 03:32:20 PM
make sure u specifyed both colors for font and backround:

Quote
.categoryselect_users {
background-color: red;
color: #ffff00;
}
Title: [MOD] Private Message System (PMS)
Post by: Gabi on May 11, 2003, 03:43:09 PM
Changed code once more like your exampel bg colour red.... same prob like before.... :oops:

you can see that in my page http://www.foto-place.de
User: Test
PW: Test
Title: [MOD] Private Message System (PMS)
Post by: V@no on May 11, 2003, 03:55:56 PM
seems just perfecly working for me...
the problem that u can not see users is because u have board integration, and this mod doesnt support any integrations...
sorry, I cant help u with that, but try do same thing what this guy/girl did for another mod:
http://4homepages.de/forum/viewtopic.php?p=23758#23758
Title: [MOD] Private Message System (PMS)
Post by: Gabi on May 11, 2003, 04:16:32 PM
Quote from: V@no
seems just perfecly working for me...
the problem that u can not see users is because u have board integration, and this mod doesnt support any integrations...
sorry, I cant help u with that, but try do same thing what this guy/girl did for another mod:
http://4homepages.de/forum/viewtopic.php?p=23758#23758


V@no,
i dont think that integation is the problem because send mass pm from admin panel with same mod works to 100%
Title: [MOD] Private Message System (PMS)
Post by: V@no on May 11, 2003, 05:00:52 PM
the mass send doesnt use user names it uses only user ids ;)
so, if read the posts I showed above, u can see what I'm talking about: in phpbb users database table has different name that stores names, that's the problem in your case. u'll need replace all user_name in the mod to username, in the same way as in the thread above
Title: [MOD] Private Message System (PMS)
Post by: Gabi on May 11, 2003, 06:08:55 PM
oki,

i changed all user_name to username in pms.php but now i get this errormassage, and unserselektbox is empty(only defaulttext is still there):

>DB Error Bad SQL Query SELECT user_id, user_level
          FROM fotopl_users
          WHERE user_level  -1 AND user_id 81
          ORDER BY  ASC You have an error in your SQL syntax near 'ASC' at line 4

You have an idea where i can serch for error ???
lg
Gabi
Title: [MOD] Private Message System (PMS)
Post by: V@no on May 11, 2003, 06:14:00 PM
yes, I have explained it in the link I showed ;)
u need replace
Code: [Select]
ORDER BY ".get_user_table_field("", "user_name")." ASC";with
Code: [Select]
ORDER BY username ASC";
Title: [MOD] Private Message System (PMS)
Post by: Gabi on May 11, 2003, 06:24:44 PM
Ups  :oops:  sorry i dont see that. Now i changed this Code too.....and what will i say 8O  it looks same like befor changing code of the tread you had posted....defauttex ok....users bg=red names=red  i think the skript could read the userstable because now the list is like before changes very long.....:oops:  :oops:
Title: [MOD] Private Message System (PMS)
Post by: V@no on May 11, 2003, 07:05:31 PM
Quote from: Gabi
users bg=red names=red

you are wrong here.
since all selections uses same class, and u can see word at the top of list and at the bottom u can see "underfined" that means, that the script didnt print names at all.
to prove that I'm right, open your site and open source of your page, then search for var user_list = this is the list generated by pms.php the format of that list is:
xx,name,xx2,name2,xx3,name3
where xx is member ID.
so, as u can see in your source it shows only xx,,xx2,,xx3,,
no names where displayed at all...so, thats not the style problem, that your integration messing up, do again changes above.
Title: [MOD] Private Message System (PMS)
Post by: Gabi on May 11, 2003, 07:21:04 PM
ups sorry you are right, in default template is same problem too. Ok now i will fix everything once more. The changes i must only do in the pms.php or in other sites too???
Title: [MOD] Private Message System (PMS)
Post by: V@no on May 11, 2003, 07:36:37 PM
if everything else works fine, then only in the pms code
Title: [MOD] Private Message System (PMS)
Post by: Gabi on May 11, 2003, 07:52:54 PM
Quote from: V@no
if everything else works fine, then only in the pms code

in line 550 is u.user_name change this too ???
line 102 changed to  "username" => $user_to['username'],
line 162 changed to  $username = get_user_info($user_id);
line 163 changed to  $message = "
Quote from: .$username['username'].
".$result['pms_text']."
";

Are the changes corect so ???? Rest of changes are no problem...
Title: [MOD] Private Message System (PMS)
Post by: Bomba on May 14, 2003, 12:31:42 AM
Quote from: V@no
Quote from: Bomba
and what about the picture comments, can they be forward to picture owner inbox?
i think it would be really cool :)

and what do want to do with comments posted by guests?


Quote from: Bomba
in my gallery, guests are not allowed to comment
only registed members can


sorry for asking this again but this mod i would really like to have :)
anyone?


thanks
Title: [MOD] Private Message System (PMS)
Post by: olinde on May 16, 2003, 11:01:01 AM
Bin am verzweifeln!!!
Habe den Code von PMS (toller MOD!!) durchgegangen und weis nicht mehr weita!
Habe folgenden Fehler:
Beim Anzeigen des Paging Stats wird nicht die richtige Lang angezeigt. Bekomme immer "Gefunden: 1 Bild(er) auf 1 Seite(n). Angezeigt: Bild 1 bis 1. " Dies steht bei mir im lang-file:
Code: [Select]
$lang['pms_paging_stats'] = "Du hast {total_cat_images} Nachricht(en) {new} auf {total_pages} Seite(n) in deinem {box}.Angezeigt: Seite {first_page} bis {last_page}.";


Jetzt hab ich mal probiert im template "pms_folder.html" dieses {paging_stats} durch {pms_paging_stats} auszutauschen. Dann bekomme ich gar keine Anzeige!!

Was habe ich falsch gemacht?

mfg
Olaf

http://olindner.axxs.de
Title: I've only one problem so far.
Post by: lakeside on May 20, 2003, 06:14:53 AM
First off, let me say thank you, it's a great mod.

But I do have a minor problem.

If im in the private messaging system (anywhere in the private messaging system, i.e. inbox, sentbox, outbox etc), and I use my logoff button which would normally take me back to the index.php page, instead it takes me to the pms.php which produces an error, like "Your not logged in".

So, Im wondering where I can change things so that if a user logs off from anywhere in the PMS system, it takes them to the index.php page instead of the pms.php page.

Also, on the comment_bit.html page, I have the code: {lang_pm}
But when I click on it, it brings out the new message page, but the user is not selected for me.  when I examine the link it says:
http://www.mydomain.com/4gallery/pms.php?action=reply&user_id=

You'll notice that the user_id= nothing.  How do I go about fixing this?

I know there is another problem that Im having as well, and thats with the popup, if a users selects to show popup message when new message is received I get the following error at the top of my sites pages:

Warning: Cannot add header information - headers already sent by (output started at /home/x1/xx2/4gallery/includes/stats.php:83) in /home/x1/xx2/4gallery/includes/page_header.php on line 126
>

On line 126 of page_header.php I have the following:
        setcookie($cookie_name.'pmsnewpopup', serialize($result['pms_date']), $cookie_expire, COOKIE_PATH, COOKIE_DOMAIN, COOKIE_SECURE);

Please note also the following is how I have my page_header.php if you remember you created some code so that I could have a direct link to the users gallery, so that might be my problem but I dont know how to solve it.

Code: [Select]
//-----------------------------------------------------
//--- PMS ---------------------------------------------
//-----------------------------------------------------
$sql = "SELECT COUNT(pms_id) AS total
                FROM ".PMS_TABLE."
                WHERE pms_to = ".$user_info['user_id']." AND (pms_type = ".PMS_SENT." OR pms_type = ".PMS_SDLT." OR pms_type = ".PMS_UNREAD.")";
$result = $site_db->query_firstrow($sql);
$pms_inbox = $result['total'];
$sql = "SELECT COUNT(pms_id) AS total
                FROM ".PMS_TABLE."
                WHERE pms_from = ".$user_info['user_id']." AND pms_type = ".PMS_UNREAD;
$result = $site_db->query_firstrow($sql);
$pms_outbox = $result['total'];
$sql = "SELECT COUNT(pms_id) AS total
                FROM ".PMS_TABLE."
                WHERE pms_from = ".$user_info['user_id']." AND (pms_type = ".PMS_SENT." OR pms_type = ".PMS_RDLT.")";
$result = $site_db->query_firstrow($sql);
$pms_sentbox = $result['total'];
$sql = "SELECT COUNT(pms_id) AS new
                FROM ".PMS_TABLE."
                WHERE pms_to = ".$user_info['user_id']." AND pms_type = ".PMS_UNREAD;
$result = $site_db->query_firstrow($sql);
$pms_new = "<a href=\"".$site_sess->url(ROOT_PATH."pms.php")."\">".(($result['new']) ? "<blink>".$result['new']."</blink>" : 0)."</a>";
$pms = preg_replace("/".$site_template->start."msg_new_count".$site_template->end."/siU", $pms_new, $lang['pms_link']);
$pms = preg_replace("/".$site_template->start."inbox".$site_template->end."/siU", "<a href=\"".$site_sess->url(ROOT_PATH."pms.php")."\">".$lang['pms_inbox']."</a>", $pms);
// PMS Boxes
$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 = ($result['new']) ? $blink."<span id=\"blnk\">".$lang['pms_inbox']."</span><script language=\"JavaScript\">blink();</script>" : $lang['pms_inbox'];
$inbox = "<a href=\"".$site_sess->url(ROOT_PATH."pms.php?action=inbox")."\" title=\"".$lang['pms_total']." (".$pms_inbox.")\">".$show_inbox."</a>";
$sentbox = "<a href=\"".$site_sess->url(ROOT_PATH."pms.php?action=sentbox")."\" title=\"".$lang['pms_total']." (".$pms_sentbox.")\">".$lang['pms_sentbox']."</a>";
$outbox = "<a href=\"".$site_sess->url(ROOT_PATH."pms.php?action=outbox")."\" title=\"".$lang['pms_total']." (".$pms_outbox.")\">".$lang['pms_outbox']."</a>";
$newpms = "<a href=\"".$site_sess->url(ROOT_PATH."pms.php?action=new")."\">".$lang['pms_new']."</a>";

$sql = "SELECT pms_date
                FROM ".PMS_TABLE."
                WHERE pms_to = ".$user_info['user_id']." AND pms_type = ".PMS_UNREAD."
                ORDER BY pms_date DESC";
$result = $site_db->query_firstrow($sql);
$pms_popup_script = "";
$pms_popup_header = "";
if ($result && $user_info['user_pms_popup'] && !ereg("pms.php", $self_url)) {
    $cookie_name = (defined("COOKIE_NAME")) ? COOKIE_NAME : "4images_";
    $cookie_pmsnewpopup = isset($HTTP_COOKIE_VARS[$cookie_name.'pmsnewpopup']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookie_name.'pmsnewpopup'])) : 0;
    $pmsnewpopup = (isset($session_info['pmsnewpopup'])) ? $session_info['pmsnewpopup'] : $cookie_pmsnewpopup;
    if ($pmsnewpopup < $result['pms_date']) {
        $cookie_expire = time() + 60 * 60 * 24 * 90;
        setcookie($cookie_name.'pmsnewpopup', serialize($result['pms_date']), $cookie_expire, COOKIE_PATH, COOKIE_DOMAIN, COOKIE_SECURE);
        $site_sess->set_session_var("pmsnewpopup", $result['pms_date']);
        $pms_popup_script = "<script language=\"JavaScript\">
        <!--
        function confirm_newpm() {
            input_box=confirm('".$lang['pms_popup_confirm']."');
            if (input_box==true) { // Output when OK is clicked
                second_box=confirm('".$lang['pms_popup_newwindow']."');
                if (second_box==true) {
                    window.open('".$site_sess->url(ROOT_PATH."pms.php")."','pmnew','width=600,height=500,menubar=yes,scrollbars=yes,toolbar=yes,location=yes,directories=yes,resizable=yes,top=50,left=50');
                } else {
                    window.location='".$site_sess->url(ROOT_PATH."pms.php")."';
                }
            } else {
            // Output when Cancel is clicked
            }
        }
        // -->
        </script>";
        $pms_popup_header = "onload=\"Javascript:confirm_newpm()\"";
    }
}

$site_template->register_vars(array(
    "pms_boxes" => ($user_info['user_level'] < USER) ? "" : $inbox."&nbsp;&nbsp;|&nbsp;&nbsp;".$sentbox."&nbsp;&nbsp;|&nbsp;&nbsp;".$outbox."&nbsp;&nbsp;|&nbsp;&nbsp;".$newpms,
    "pms_popup_script" => $pms_popup_script,
    "pms_popup_header" => $pms_popup_header,
  "media_url" => MEDIA_PATH,
"user_cat_url" => ($user_cat_id) ? "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?cat_id=".$user_cat_id)."\" class=\"box2\">My Gallery</a>" : "",


Thanks again
Title: Re: I've only one problem so far.
Post by: V@no on May 20, 2003, 06:23:23 AM
Quote from: lakeside
So, Im wondering where I can change things so that if a user logs off from anywhere in the PMS system, it takes them to the index.php page instead of the pms.php page.

heiko already asked ;):
http://4homepages.de/forum/viewtopic.php?p=23679#23679
Title: [MOD] Private Message System (PMS)
Post by: lakeside on May 20, 2003, 06:32:22 AM
Sorry, I must have missed that and I read all 6 pages, at least all that I thought was in english.  But the rest of my problems still stand unfortunately (I hit send before writing them all, so I edited it).

Again thanks for your time,
Title: [MOD] Private Message System (PMS)
Post by: lakeside on May 21, 2003, 06:14:59 AM
Sorry to *BUMP*, but im at a loss as to the rest of my edited questions and problems.

V@no, can you help with this.

I know, I hate bumps too, but Im deperate as I didnt make backups as I should have, so now it's only partially working.
Title: Re: I've only one problem so far.
Post by: V@no on May 21, 2003, 12:52:27 PM
Quote from: lakeside
Also, on the comment_bit.html page, I have the code: {lang_pm}
But when I click on it, it brings out the new message page, but the user is not selected for me.

ah, yes, sorry, that was my bad...I just updated Step 8.

Quote from: lakeside
I know there is another problem that Im having as well, and thats with the popup, if a users selects to show popup message when new message is received I get the following error at the top of my sites pages:


I just tryed the code you posted - nothing happend...
would u PM me with entire page_header.php?
Title: [MOD] Private Message System (PMS)
Post by: lakeside on May 22, 2003, 03:33:27 AM
Okay, I've pm'd you the entire page_header.php file.

Another problem Im having, dont know whats going on.

I use {pms} in my userlogin_info.html template, but nothing shows up for it.  It should show, "you have 2 new messages in your inbox"  but it shows nothing when there is 1 new message in my inbox.

Did I miss a step, or is this related specifically to my pageheader.php file or something left out of the coding all together?

Thanks for your time and effort V@no, it is much appreciated.
Title: [MOD] Private Message System (PMS)
Post by: the_spirit on May 22, 2003, 11:11:28 PM
Have i missed something.. ?

Warning: Wrong parameter count for trim() in C:\apache\htdocs\4images\pms.php on line 274


And line 274 in pms.php is

"user_list" => trim($user_list, ","),

The error only shows at the top of the page in "new message"
In Inbox, sentbox, outbox i dont gets the error
Title: [MOD] Private Message System (PMS)
Post by: lakeside on May 25, 2003, 05:06:15 AM
V@no: Any solution yet with the page_header.php that I pm'd you?  Sorry to be a bother.

Thank you again,
Title: [MOD] Private Message System (PMS)
Post by: V@no on May 25, 2003, 05:27:11 AM
Quote from: lakeside
V@no: Any solution yet with the page_header.php that I pm'd you?
no, sorry, it didnt give me any error messages, even though the popup didnt work either...
Title: [MOD] Private Message System (PMS)
Post by: IngoT on June 04, 2003, 11:30:56 AM
Hallo, ich habe 4 (kleinere) Fehler bei der Ausführung des PMS.

(http://www.digitalfotograf.com/temp/pms2.jpg)

und

(http://www.digitalfotograf.com/temp/pms1.jpg)

außerdem lässt sich in dem Textfeld geschriebener Text nicht mit der Maus markieren (also Linksklick und ziehen).

BBCode habe ich erstmal rausgenommen, weil er nicht richtig funktionierte. Bei B, I und U kamen keine Eingabefelder, was sonst eigentlich im restlichen Forum funktioniert.

Der Eintrag von {lang_pm} in der member_profile.html bringt keine Anzeige von PM

Hat jemand Hilfe für diese Fehler?

Gruß Ingo.
http://www.digitalfotograf.com/bilderkiste
Title: Bug im Script?
Post by: IngoT on June 04, 2003, 11:33:56 PM
Hallo, ich habe vermutlich einen Fehler entdeckt, warscheinlich ist er noch keinem weiter aufgefallen. Hier mal die "Anleitung" wie der Fehler zustande kommt:

Schritte wie folgt: Im Ordner Posteingang...oder Gesendet... oder Postausgang

1. Keine Nachrichten ausgewählt -> auf den Button alle Nachrichten löschen gedrückt-> Nein gewählt-> wieder zurück

2. Eine Nachricht gewählt -> Button "Ausgewählte Nachrichten löschen" gedrückt -> der gleiche Dialog mit der Frage "ALLE löschen?" erscheint und alle Nachrichten sind weg.

Das ist ziemlich gemein! Ist das nur bei mir oder könnt Ihr diesen Fehler auch bestätigen?

Gruß Ingo.
Title: [MOD] Private Message System (PMS)
Post by: IngoT on June 13, 2003, 03:40:48 PM
Hallo, bin ich der einzigste, der diese Problematik hat? Muß das Thema noch einmal nach oben schieben.

Gruß Ingo.
Title: [MOD] Private Message System (PMS)
Post by: Slammer on June 14, 2003, 12:52:29 PM
it works, and it's GREAT!!  :lol:
Title: [MOD] Private Message System (PMS)
Post by: lakeside on June 17, 2003, 07:55:58 PM
Okay, Im posting my page_header.php and my stats.php here in code so that hopefully someone else can help me diagnose why I dont get the popup box, but instead get the error message:
Warning: Cannot add header information - headers already sent by (output started at /home/xxx/xxx-www/gallery/includes/stats.php:83) in /home/xxx/xxx-www/gallery/includes/page_header.php on line 126

Heres my stats.php file:
Code: [Select]
<?PHP

//-----------------------------------------------------
//--- Show number of Users ----------------------------
//-----------------------------------------------------
   $sql = "SELECT COUNT(*) as users
          FROM ".USERS_TABLE."
          WHERE user_id <> ".GUEST;
  $row = $site_db->query_firstrow($sql);

  $total_users = "".$lang['users']."<B> ".$row['users']."</B>\n";
   
  $site_template->register_vars("total_users", $total_users);
unset($total_users);

//-----------------------------------------------------
//--- Hits --------------------------------------------
//-----------------------------------------------------
    $sql = "SELECT SUM(image_hits) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_hits = "".$lang['total_hits']."<B> ".$row['sum']."</B>\n";
   
  $site_template->register_vars("total_hits", $total_hits);
unset($total_hits);

//-----------------------------------------------------
//--- Votes -------------------------------------------
//-----------------------------------------------------
    $sql = "SELECT SUM(image_votes) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_votes = "".$lang['total_votes']."<B> ".$row['sum']."</B>\n";
   
  $site_template->register_vars("total_votes", $total_votes);
unset($total_votes);

//-----------------------------------------------------
//--- Downloads ---------------------------------------
//-----------------------------------------------------
    $sql = "SELECT SUM(image_downloads) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_downloads = "".$lang['total_downloads']."<B> ".$row['sum']."</B>\n";
   
  $site_template->register_vars("total_downloads", $total_downloads);
unset($total_downloads);

//-----------------------------------------------------
//--- Comments ----------------------------------------
//-----------------------------------------------------
    $sql = "SELECT SUM(image_comments) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_comments = "".$lang['total_comments']."<B> ".$row['sum']."</B>\n";
   
  $site_template->register_vars("total_comments", $total_comments);
unset($total_comments);

//-----------------------------------------------------
//--- New Member --------------------------------------
//-----------------------------------------------------
//   $sql = "SELECT *
//          FROM ".USERS_TABLE."
//          WHERE user_level > ".USER_AWAITING."
//          ORDER by user_joindate DESC";
//  $row = $site_db->query_firstrow($sql);
//
 // $new_member = "Welcome to our newest member, ".(($row['user_id']) ? " <a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><B>".$row['user_name']."</B></a>\n" : "<B>".$row['user_name']."</B>");
 // $site_template->register_vars("new_member", $new_member);
 // unset($new_member);


?>


And here is my entire page_header.php:
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File&#58; page_header.php                                      *
 *        Copyright&#58; &#40;C&#41; 2002 Jan Sorgalla                                *
 *            Email&#58; jan@4homepages.de                                    *
 *              Web&#58; http&#58;//www.4homepages.de                             *
 *    Scriptversion&#58; 1.7                                                  *
 *                                                                        *
 *    Never released without support from&#58; Nicky &#40;http&#58;//www.nicky.net&#41;   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen &#40;Lizenz.txt&#41; für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    &#40;Licence.txt&#41; for further information.                              *
 *                                                                        *
 *************************************************************************/
if &#40;!defined&#40;'ROOT_PATH'&#41;&#41; &#123;
  
die&#40;"Security violation"&#41;;
&#125;
//----------------------------------------------------- 
//--- Maintenance      -------------------------------- 
//----------------------------------------------------- 
$maintenance $config['maintenance'&#93;; 
$redirect_url TEMPLATE_PATH."/maintenance.html"
if &
#40;$maintenance&#41;&#123; 
  
header&#40;"Location&#58; ".$site_sess->url&#40;$redirect_url, "&"&#41;&#41;; 
  
exit; 
&
#125; 

//----------------------------------------------------- 
//--- End of Maintenance      ------------------------- 
//-----------------------------------------------------
// Cache Templates
$template_list 'header,footer,category_dropdown_form,user_logininfo,user_loginform';
if &
#40;isset&#40;$templates_used&#41; && $templates_used != ""&#41; &#123;
  
$template_list $template_list.",".$templates_used;
&
#125;
$site_template->cache_templates&#40;$template_list&#41;;
$waktu=date&#40;"l, j F Y"&#41;;
$site_template->register_vars&#40;"date",$waktu&#41;;
//-----------------------------------------------------
//--- Register Global Vars ----------------------------
//-----------------------------------------------------
$total_images 0;
$total_categories 0;
$auth_cat_sql['auth_viewcat'&#93;['IN'&#93; = 0;
$auth_cat_sql['auth_viewcat'&#93;['NOTIN'&#93; = 0;
if &#40;!empty&#40;$cat_cache&#41;&#41; &#123;
  
foreach &#40;$cat_cache as $key => $val&#41; &#123;
    
if &#40;check_permission&#40;"auth_viewcat", $key&#41;&#41; &#123;
      
$total_categories++;
      if &
#40;isset&#40;$val['num_images'&#93;&#41;&#41; &#123;
        
$total_images += $val['num_images'&#93;;
      
&#125;
      
else &#123;
        
$cat_cache[$key&#93;['num_images'&#93; = 0;
      
&#125;
      
$auth_cat_sql['auth_viewcat'&#93;['IN'&#93; .= ", ".$key;
    
&#125;
    
else &#123;
      
$auth_cat_sql['auth_viewcat'&#93;['NOTIN'&#93; .= ", ".$key;
    
&#125;
  
&#125;
&#125;

  
$user_cat_id ""
foreach&
#40;$cat_cache as $key => $val&#41;&#123; 
    
if &#40;$user_info['user_name'&#93; == $cat_cache[$key&#93;['cat_name'&#93;&#41; &#123;
        
$user_cat_id $key
        break; 
    &
#125; 
&#125; 
//----------------------------------------------------- 
//--- PMS --------------------------------------------- 
//----------------------------------------------------- 
$sql "SELECT COUNT&#40;pms_id&#41; AS total 
                FROM "
.PMS_TABLE.
                WHERE pms_to = "
.$user_info['user_id'&#93;." AND &#40;pms_type = ".PMS_SENT." OR pms_type = ".PMS_SDLT." OR pms_type = ".PMS_UNREAD."&#41;"; 
$result $site_db->query_firstrow&#40;$sql&#41;; 
$pms_inbox $result['total'&#93;; 
$sql "SELECT COUNT&#40;pms_id&#41; AS total 
                FROM "
.PMS_TABLE.
                WHERE pms_from = "
.$user_info['user_id'&#93;." AND pms_type = ".PMS_UNREAD; 
$result $site_db->query_firstrow&#40;$sql&#41;; 
$pms_outbox $result['total'&#93;; 
$sql "SELECT COUNT&#40;pms_id&#41; AS total 
                FROM "
.PMS_TABLE.
                WHERE pms_from = "
.$user_info['user_id'&#93;." AND &#40;pms_type = ".PMS_SENT." OR pms_type = ".PMS_RDLT."&#41;"; 
$result $site_db->query_firstrow&#40;$sql&#41;; 
$pms_sentbox $result['total'&#93;; 
$sql "SELECT COUNT&#40;pms_id&#41; AS new 
                FROM "
.PMS_TABLE.
                WHERE pms_to = "
.$user_info['user_id'&#93;." AND pms_type = ".PMS_UNREAD; 
$result $site_db->query_firstrow&#40;$sql&#41;; 
$pms_new "<a href=\"".$site_sess->url&#40;ROOT_PATH."pms.php"&#41;."\">".&#40;&#40;$result['new'&#93;&#41; ? "<blink>".$result['new'&#93;."</blink>" &#58; 0&#41;."</a>"; 
$pms preg_replace&#40;"/".$site_template->start."msg_new_count".$site_template->end."/siU", $pms_new, $lang['pms_link'&#93;&#41;; 
$pms preg_replace&#40;"/".$site_template->start."inbox".$site_template->end."/siU", "<a href=\"".$site_sess->url&#40;ROOT_PATH."pms.php"&#41;."\">".$lang['pms_inbox'&#93;."</a>", $pms&#41;; 
// PMS Boxes 
$blink "<script language=\"JavaScript\">\n<!--\nvar flg=0;\nfunction blink&#40;&#41;&#123;\nvar myElement=document.getElementById&#40;'blnk'&#41;;\nflg^=1;\nif&#40;flg==1&#41;&#123;\nmyElement.style.visibility='hidden';\n&#125;\nelse&#123;\nmyElement.style.visibility='visible';\n&#125;\ntimerID = setTimeout&#40; 'blink&#40;&#41;' , 500 &#41;;\n&#125;\n//-->\n</script>\n"
$show_inbox = &#40;$result['new'&#93;&#41; ? $blink."<span id=\"blnk\">".$lang['pms_inbox'&#93;."</span><script language=\"JavaScript\">blink&#40;&#41;;</script>" &#58; $lang['pms_inbox'&#93;; 
$inbox "<a href=\"".$site_sess->url&#40;ROOT_PATH."pms.php?action=inbox"&#41;."\" title=\"".$lang['pms_total'&#93;." &#40;".$pms_inbox."&#41;\">".$show_inbox."</a>"; 
$sentbox "<a href=\"".$site_sess->url&#40;ROOT_PATH."pms.php?action=sentbox"&#41;."\" title=\"".$lang['pms_total'&#93;." &#40;".$pms_sentbox."&#41;\">".$lang['pms_sentbox'&#93;."</a>"; 
$outbox "<a href=\"".$site_sess->url&#40;ROOT_PATH."pms.php?action=outbox"&#41;."\" title=\"".$lang['pms_total'&#93;." &#40;".$pms_outbox."&#41;\">".$lang['pms_outbox'&#93;."</a>"; 
$newpms "<a href=\"".$site_sess->url&#40;ROOT_PATH."pms.php?action=new"&#41;."\">".$lang['pms_new'&#93;."</a>"; 

$sql "SELECT pms_date 
                FROM "
.PMS_TABLE.
                WHERE pms_to = "
.$user_info['user_id'&#93;." AND pms_type = ".PMS_UNREAD." 
                
ORDER BY pms_date DESC"; 
$result = $site_db->query_firstrow&#40;$sql&#41;; 
$pms_popup_script = ""; 
$pms_popup_header = ""; 
if &#40;
$result && $user_info['user_pms_popup'&#93; && !ereg&#40;"pms.php", $self_url&#41;&#41; &#123; 
    
$cookie_name = &#40;defined&#40;"COOKIE_NAME"&#41;&#41; ? COOKIE_NAME &#58; "4images_"; 
    
$cookie_pmsnewpopup = isset&#40;$HTTP_COOKIE_VARS[$cookie_name.'pmsnewpopup'&#93;&#41; ? unserialize&#40;stripslashes&#40;$HTTP_COOKIE_VARS[$cookie_name.'pmsnewpopup'&#93;&#41;&#41; &#58; 0; 
    
$pmsnewpopup = &#40;isset&#40;$session_info['pmsnewpopup'&#93;&#41;&#41; ? $session_info['pmsnewpopup'&#93; &#58; $cookie_pmsnewpopup
    if &#40;
$pmsnewpopup < $result['pms_date'&#93;&#41; &#123; 
        
$cookie_expire = time&#40;&#41; + 60 * 60 * 24 * 90; 
        setcookie&#40;
$cookie_name.'pmsnewpopup', serialize&#40;$result['pms_date'&#93;&#41;, $cookie_expire, COOKIE_PATH, COOKIE_DOMAIN, COOKIE_SECURE&#41;; 
        
$site_sess->set_session_var&#40;"pmsnewpopup", $result['pms_date'&#93;&#41;; 
        
$pms_popup_script = "<script language=\"JavaScript\"> 
        <!-- 
        function confirm_newpm&#40;&#41; &#123; 
            input_box=confirm&#40;'"
.$lang['pms_popup_confirm'&#93;."'&#41;; 
            
if &#40;input_box==true&#41; &#123; // Output when OK is clicked 
                
second_box=confirm&#40;'".$lang['pms_popup_newwindow'&#93;."'&#41;; 
                
if &#40;second_box==true&#41; &#123; 
                    
window.open&#40;'".$site_sess->url&#40;ROOT_PATH."pms.php"&#41;."','pmnew','width=600,height=500,menubar=yes,scrollbars=yes,toolbar=yes,location=yes,directories=yes,resizable=yes,top=50,left=50'&#41;; 
                
&#125; else &#123; 
                    
window.location='".$site_sess->url&#40;ROOT_PATH."pms.php"&#41;."'
                &
#125; 
            
&#125; else &#123; 
            // Output when Cancel is clicked 
            
&#125; 
        
&#125; 
        // --> 
        
</script>"; 
        
$pms_popup_header = "onload=\"Javascript&#58;confirm_newpm&#40;&#41;\""
    &
#125; 
&#125; 

$site_template->register_vars&#40;array&#40; 
    
"pms_boxes" => &#40;$user_info['user_level'&#93; < USER&#41; ? "" &#58; $inbox."&nbsp;&nbsp;|&nbsp;&nbsp;".$sentbox."&nbsp;&nbsp;|&nbsp;&nbsp;".$outbox."&nbsp;&nbsp;|&nbsp;&nbsp;".$newpms, 
    
"pms_popup_script" => $pms_popup_script
    
"pms_popup_header" => $pms_popup_header
  
"media_url" => MEDIA_PATH
"user_cat_url" => &#40;$user_cat_id&#41; ? "<a href=\"".$site_sess->url&#40;ROOT_PATH."categories.php?cat_id=".$user_cat_id&#41;."\" class=\"box2\">My Gallery</a>" &#58; "",
  
"thumb_url" => THUMB_PATH,
  
"icon_url" => ICON_PATH,
  
"template_url" => TEMPLATE_PATH,
  
"template_image_url" => TEMPLATE_PATH."/images",
  
"template_lang_image_url" => TEMPLATE_PATH."/images_".$config['language_dir'&#93;,
  
"site_name" => $config['site_name'&#93;,
  
"site_email" => $config['site_email'&#93;,
  
"self" => $site_sess->url&#40;$self_url&#41;,
  
"self_full" => $site_sess->url&#40;$script_url."/".$self_url&#41;,
  
"script_version" => SCRIPT_VERSION,
  
"cp_link" => &#40;$user_info['user_level'&#93; != ADMIN&#41; ? "" &#58; "\n<p align=\"center\">[<a href=\"".$site_sess->url&#40;ROOT_PATH."admin/index.php"&#41;."\">Control Panel</a>&#93;</p>\n",
  
"total_categories" => $total_categories,
  
"total_images" => $total_images,
  
"url_new_images" => $site_sess->url&#40;ROOT_PATH."search.php?search_new_images=1"&#41;,
  
"url_top_images" => $site_sess->url&#40;ROOT_PATH."top.php"&#41;,
  
"url_top_cat_images" => $site_sess->url&#40;ROOT_PATH."top.php".&#40;&#40;$cat_id && preg_match&#40;"/categories.php/", $self_url&#41;&#41; ? "?".URL_CAT_ID."=".$cat_id &#58; ""&#41;&#41;,
  
"url_register" => &#40;!empty&#40;$url_register&#41;&#41; ? $site_sess->url&#40;$url_register&#41; &#58; $site_sess->url&#40;ROOT_PATH."register.php"&#41;,
  
"url_search" => $site_sess->url&#40;ROOT_PATH."search.php"&#41;,
  
"url_lightbox" => $site_sess->url&#40;ROOT_PATH."lightbox.php"&#41;,
  
"url_control_panel" => &#40;!empty&#40;$url_control_panel&#41;&#41; ? $site_sess->url&#40;$url_control_panel&#41; &#58; $site_sess->url&#40;ROOT_PATH."member.php?action=editprofile"&#41;,
  
"url_categories" => $site_sess->url&#40;ROOT_PATH."categories.php"&#41;,
  
"url_home" => $site_sess->url&#40;ROOT_PATH."index.php"&#41;,
  
"url_login" => &#40;!empty&#40;$url_login&#41;&#41; ? $site_sess->url&#40;$url_login&#41; &#58; $site_sess->url&#40;ROOT_PATH."login.php"&#41;,
  
"url_logout" => &#40;!empty&#40;$url_logout&#41;&#41; ? $site_sess->url&#40;$url_logout&#41; &#58; $site_sess->url&#40;ROOT_PATH."logout.php"&#41;,
  
"url_member" => &#40;!empty&#40;$url_member&#41;&#41; ? $site_sess->url&#40;$url_member&#41; &#58; $site_sess->url&#40;ROOT_PATH."member.php"&#41;,
  
"url_upload" => &#40;!empty&#40;$url_upload&#41;&#41; ? $site_sess->url&#40;$url_upload&#41; &#58; $site_sess->url&#40;ROOT_PATH."member.php?action=uploadform"&#41;,
  
"url_lost_password" => &#40;!empty&#40;$url_lost_password&#41;&#41; ? $site_sess->url&#40;$url_lost_password&#41; &#58; $site_sess->url&#40;ROOT_PATH."member.php?action=lostpassword"&#41;,
  
"guest" => &#40;$user_info['user_level'&#93; == GUEST&#41; ? 1 &#58; 0
&#41;&#41;;

if &#40;!empty&#40;$additional_urls&#41;&#41; &#123;
  
$register_array = array&#40;&#41;;
  
foreach &#40;$additional_urls as $key => $val&#41; &#123;
    
$register_array[$key&#93; = $site_sess->url&#40;$val&#41;;
  
&#125;
  
$site_template->register_vars&#40;$register_array&#41;;
&#125;

// Replace Globals in $lang
$lang $site_template->parse_array&#40;$lang&#41;;

$site_template->register_vars&#40;array&#40;
  
"lang_site_stats" => $lang['site_stats'&#93;,
  
"lang_registered_user" => $lang['registered_user'&#93;,
  
"lang_random_image" => $lang['random_image'&#93;,
  
"lang_categories" => $lang['categories'&#93;,
  
"lang_sub_categories" => $lang['sub_categories'&#93;,
  
"lang_new_images" => $lang['new_images'&#93;,
  
"lang_top_images" => $lang['top_images'&#93;,
  
"lang_search" => $lang['search'&#93;,
  
"lang_advanced_search" => $lang['advanced_search'&#93;,
  
"lang_lightbox" => $lang['lightbox'&#93;,
  
"lang_register" => $lang['register'&#93;,
  
"lang_reregister" => $lang['reregister'&#93;,
  
"lang_control_panel" => $lang['control_panel'&#93;,
  
"lang_login" => $lang['login'&#93;,
  
"lang_auto_login" => $lang['lang_auto_login'&#93;,
  
"lang_logout" => $lang['logout'&#93;,
  
"lang_lost_password" => $lang['lost_password'&#93;,
  
"lang_user_name" => $lang['user_name'&#93;,
  
"lang_password" => $lang['password'&#93;,
  
"lang_go" => $lang['go'&#93;,
  
"lang_images_per_page" => $lang['images_per_page'&#93;,
  
"lang_user_online" => $lang['user_online'&#93;,
  
"lang_user_online_detail" => $lang['user_online_detail'&#93;,
  
"charset" => $lang['charset'&#93;,
  
"direction" => $lang['direction'&#93;,
  
"memberbar" => $lang['memberbar'&#93;
&#41;&#41;;

//-----------------------------------------------------
//--- Category Dropdown -------------------------------
//-----------------------------------------------------
$category_dropdown_selfjump get_category_dropdown&#40;$cat_id, 1&#41;;
$site_template->register_vars&#40;"category_dropdown_selfjump", $category_dropdown_selfjump&#41;;
$category_dropdown_form $site_template->parse_template&#40;"category_dropdown_form"&#41;;
$site_template->register_vars&#40;array&#40;"category_dropdown_form" => $category_dropdown_form&#41;&#41;;

$site_template->un_register_vars&#40;"category_dropdown_selfjump"&#41;;
unset&#40;$category_dropdown_selfjump&#41;;
unset&#40;$category_dropdown_form&#41;;

//-----------------------------------------------------
//--- Random Image ------------------------------------
//-----------------------------------------------------
$random_image = &#40;defined&#40;"SHOW_RANDOM_IMAGE"&#41; && SHOW_RANDOM_IMAGE == 0&#41; ? "" &#58; get_random_image&#40;&#41;;
$site_template->register_vars&#40;"random_image", $random_image&#41;;
unset&#40;$random_image&#41;;
//----------------------------------------------------- 
//--- Photo Of The Day -------------------------------- 
//----------------------------------------------------- 

$potd_image = &#40;defined&#40;"SHOW_POTD_IMAGE"&#41; && SHOW_POTD_IMAGE == 0&#41; ? "" &#58; get_potd_image&#40;&#41;; 
$site_template->register_vars&#40;"potd_image", $potd_image&#41;; 
$site_template->register_vars&#40;array&#40;"lang_potd_title" => $lang['potd_title'&#93;&#41;&#41;; 
switch &#40;POTD_SELECT_MODE&#41; &#123; 
    
case "by_rating"    &#58; $site_template->register_vars&#40;array&#40;"lang_potd_type" => $lang['potd_type_rating'&#93;&#41;&#41;; break; 
    
case "by_votes"     &#58; $site_template->register_vars&#40;array&#40;"lang_potd_type" => $lang['potd_type_votes'&#93;&#41;&#41;; break; 
    
case "by_comments"  &#58; $site_template->register_vars&#40;array&#40;"lang_potd_type" => $lang['potd_type_comments'&#93;&#41;&#41;; break; 
    
case "by_downloads" &#58; $site_template->register_vars&#40;array&#40;"lang_potd_type" => $lang['potd_type_downloads'&#93;&#41;&#41;; break; 
    
case "by_hits"      &#58; $site_template->register_vars&#40;array&#40;"lang_potd_type" => $lang['potd_type_hits'&#93;&#41;&#41;; break; 
&#125; 
unset&#40;$potd_image&#41;; 

//--- End Photo Of The Day ----------------------------
//-----------------------------------------------------
//--- Set Paging Vars ---------------------------------
//-----------------------------------------------------
if &#40;isset&#40;$HTTP_POST_VARS['setperpage'&#93;&#41;&#41; &#123;
  
$setperpage intval&#40;$HTTP_POST_VARS['setperpage'&#93;&#41;;
  
if &#40;$setperpage&#41; &#123;
    
$site_sess->set_session_var&#40;"perpage", $setperpage&#41;;
    
$session_info['perpage'&#93; = $setperpage;
  
&#125;
&#125;

if &#40;isset&#40;$session_info['perpage'&#93;&#41;&#41; &#123;
  
$perpage $session_info['perpage'&#93;;
&#125;
else &#123;
  
$perpage ceil&#40;$config['default_image_rows'&#93; * $config['image_cells'&#93;&#41;;
&#125;

//-----------------------------------------------------
//--- Set Perpage Dropdown ----------------------------
//-----------------------------------------------------
$setperpage_dropdown "\n<select name=\"setperpage\" class=\"setperpageselect\">\n";
for&
#40;$i = 1; $i <= $config['custom_row_steps'&#93;; $i++&#41; &#123;
  
$setvalue $config['image_cells'&#93; * $i;
  
$setperpage_dropdown .= "<option value=\"".$setvalue."\"";
    if &
#40;$setvalue == $perpage&#41; &#123;
    
$setperpage_dropdown .= " selected=\"selected\"";
  &
#125;
  
$setperpage_dropdown .= ">";
  
$setperpage_dropdown .= $setvalue;
  
$setperpage_dropdown .= "</option>\n";
&
#125;
$setperpage_dropdown .= "</select>\n";
if &
#40;$cat_id != 0&#41; &#123;
  
$setperpage_dropdown .= "<input type=\"hidden\" name=\"cat_id\" value=\"".$cat_id."\" />\n";
&
#125;
if &#40;isset&#40;$show_result&#41; && $show_result == 1&#41; &#123;
  
$setperpage_dropdown .= "<input type=\"hidden\" name=\"show_result\" value=\"1\" />\n";
&
#125;
$site_template->register_vars&#40;"setperpage_dropdown", $setperpage_dropdown&#41;;
$setperpage_dropdown_form $site_template->parse_template&#40;"setperpage_dropdown_form"&#41;;
$site_template->register_vars&#40;"setperpage_dropdown_form", $setperpage_dropdown_form&#41;;

$site_template->un_register_vars&#40;"setperpage_dropdown"&#41;;
unset&#40;$setperpage_dropdown&#41;;
unset&#40;$setperpage_dropdown_form&#41;;

//-----------------------------------------------------
//--- Add & Delete from Lists -------------------------
//-----------------------------------------------------
if &#40;$action == "addtolightbox" && $id&#41; &#123;
  
if &#40;$user_info['user_level'&#93; >= USER&#41; &#123;
    
$msg = &#40;add_to_lightbox&#40;$id&#41;&#41; ? $lang['lightbox_add_success'&#93; &#58; $lang['lightbox_add_error'&#93;;
  
&#125;
  
else &#123;
    
$msg $lang['lightbox_register'&#93;;
  
&#125;
&#125;
if &#40;$action == "removefromlightbox" && $id&#41; &#123;
  
if &#40;$user_info['user_level'&#93; >= USER&#41; &#123;
    
$msg = &#40;remove_from_lightbox&#40;$id&#41;&#41; ? $lang['lightbox_remove_success'&#93; &#58; $lang['lightbox_remove_error'&#93;;
  
&#125;
  
else &#123;
    
$msg $lang['lightbox_register'&#93;;
  
&#125;
&#125;
if &#40;$action == "clearlightbox"&#41; &#123;
  
if &#40;$user_info['user_level'&#93; >= USER&#41; &#123;
    
$msg = &#40;clear_lightbox&#40;&#41;&#41; ? $lang['lightbox_delete_success'&#93; &#58; $lang['lightbox_delete_error'&#93;;
  
&#125;
  
else &#123;
    
$msg $lang['lightbox_register'&#93;;
  
&#125;
&#125;

//-----------------------------------------------------
//--- Save Rating -------------------------------------
//-----------------------------------------------------
if &#40;$action == "rateimage" && $id&#41; &#123;
  
$rating intval&#40;$HTTP_POST_VARS['rating'&#93;&#41;;
  
$cookie_name = &#40;defined&#40;"COOKIE_NAME"&#41;&#41; ? COOKIE_NAME &#58; "4images_";
  
$cookie_rated = isset&#40;$HTTP_COOKIE_VARS[$cookie_name.'rated'&#93;&#41; ? unserialize&#40;stripslashes&#40;$HTTP_COOKIE_VARS[$cookie_name.'rated'&#93;&#41;&#41; &#58; array&#40;&#41;;
  
if &#40;$rating && $rating <= MAX_RATING && $id&#41; &#123;
    
if &#40;!isset&#40;$session_info['rated_imgs'&#93;&#41;&#41; &#123;
      
$session_info['rated_imgs'&#93; = $site_sess->get_session_var&#40;"rated_imgs"&#41;;
    
&#125;    
    
$split_list = array&#40;&#41;;
    
if &#40;!empty&#40;$session_info['rated_imgs'&#93;&#41;&#41; &#123;
      
$split_list explode&#40;" ", $session_info['rated_imgs'&#93;&#41;;
    
&#125;
    
if &#40;!in_array&#40;$id, $split_list&#41; && !in_array&#40;$id, $cookie_rated&#41;&#41; &#123;
      
$session_info['rated_imgs'&#93; .= " ".$id;
      
$session_info['rated_imgs'&#93; = trim&#40;$session_info['rated_imgs'&#93;&#41;;
      
$site_sess->set_session_var&#40;"rated_imgs", $session_info['rated_imgs'&#93;&#41;;
      
$cookie_rated[&#93; = $id;
      
$cookie_expire time&#40;&#41; + 60 * 60 * 24 * 4;
      
setcookie&#40;$cookie_name.'rated', serialize&#40;$cookie_rated&#41;, $cookie_expire, COOKIE_PATH, COOKIE_DOMAIN, COOKIE_SECURE&#41;;
      
update_image_rating&#40;$id, $rating&#41;;
      
$msg $lang['voting_success'&#93;;
    
&#125;
    
else &#123;
      
$msg $lang['already_voted'&#93;;
    
&#125;
  
&#125;
  
else &#123;
    
$msg $lang['voting_error'&#93;;
  
&#125;
&#125;

//-----------------------------------------------------
//--- Parse Header & Footer ---------------------------
//-----------------------------------------------------
if &#40;isset&#40;$main_template&#41; && $main_template&#41; &#123;
  
$header $site_template->parse_template&#40;"header"&#41;;
  
$footer $site_template->parse_template&#40;"footer"&#41;;
  
$site_template->register_vars&#40;array&#40;
    
"header" => $header,
    
"footer" => $footer
  
&#41;&#41;;
  
unset&#40;$header&#41;;
  
unset&#40;$footer&#41;;
&#125;

//-----------------------------------------------------
//--- User Box ----------------------------------------
//-----------------------------------------------------
if &#40;$user_info['user_level'&#93; >= USER&#41; &#123;
  
$site_template->register_vars&#40;"lang_loggedin_msg", preg_replace&#40;"/".$site_template->start."loggedin_user_name".$site_template->end."/siU", $user_info['user_name'&#93;, $lang['lang_loggedin_msg'&#93;&#41;&#41;;
  
$user_box $site_template->parse_template&#40;"user_logininfo"&#41;;
  
$site_template->register_vars&#40;array&#40;
    
"user_box" => $user_box,
    
"user_loggedin" => 1,
    
"user_loggedout" => 0,
    
"is_admin" => &#40;$user_info['user_level'&#93; == ADMIN&#41; ? 1 &#58; 0

  
&#41;&#41;;  
  
$site_template->un_register_vars&#40;"user_logininfo"&#41;;
  
unset&#40;$user_box&#41;;
&#125;
else &#123;
  
$user_box $site_template->parse_template&#40;"user_loginform"&#41;;
  
$site_template->register_vars&#40;array&#40;
    
"user_box" => $user_box,
    
"user_loggedin" => 0,
    
"user_loggedout" => 1,
    
"is_admin" => 0
  
&#41;&#41;;
  
$site_template->un_register_vars&#40;"user_loginform"&#41;;
  
unset&#40;$user_box&#41;;
&#125;
?>
Title: [MOD] Private Message System (PMS)
Post by: V@no on June 18, 2003, 12:17:47 AM
it didnt give any error messages, but popup didnt showed up either...can I see your site?
Title: [MOD] Private Message System (PMS)
Post by: lakeside on June 18, 2003, 12:44:45 AM
URL sent in private (to protect the innocent) hehehehe
Title: [MOD] Private Message System (PMS)
Post by: spoiledRHOtten on June 21, 2003, 10:10:39 PM
OKay...I have a style question.

The PMS Boxes are set up to show like this:

INbox | Sentbox | Outbox | New Message

okay...that's great...

but what if in a different template... I want it to show up as

Inbox{br}
Sentbox{br}
Outbox{br}
New Message{br}

I would like to keep the original set up...it's just that in a different template, I'd like them to show up straight down instead of side by side.

Any ideas?
Title: [MOD] Private Message System (PMS)
Post by: V@no on June 21, 2003, 11:19:15 PM
sorry, its not possible in current version, the boxes created in .php files...
will change it in next version ;)
Title: [MOD] Private Message System (PMS)
Post by: spoiledRHOtten on June 21, 2003, 11:20:53 PM
Quote from: V@no
sorry, its not possible in current version, the boxes created in .php files...
will change it in next version ;)


*CHEESE* I figured out how to do it. :)
Title: [MOD] Private Message System (PMS)
Post by: spoiledRHOtten on June 23, 2003, 03:03:05 AM
what about this?

Is there a way to include the from user's avatar in the PM?

Most of my users upload their own photos as their avatars. It would be great if that could be visible in the PM as it is in the Comments.

Any ideas how?
Title: Re: [MOD] Private Message System (PMS)
Post by: Tarps on March 11, 2005, 07:26:00 PM
hm dead link ?! 8O
Title: Re: [MOD] Private Message System (PMS)
Post by: V@no on March 12, 2005, 12:11:19 AM
sorry, this mod is not supported for a year now, there was version 2 which is different from this...

Sorry, please wait a few days (or maybe weeks) untill I post the v2 instructions.
If u installed this mod already, I'd suggest u uninstall it (u'll need to do so anyway if u want to use v2)
Title: Re: [MOD] Private Message System (PMS) not supported anymore!
Post by: Tarzan on May 16, 2005, 02:44:12 AM
Hallo zusammen,

ich kann nach der installation des Mods meine Galerie nicht mehr öffnen. Bekomme folgende Fehlermeldung:

Parse error: parse error, unexpected T_STRING in /mnt/kw2/08/926/00000017/htdocs/geschuetzt/pics/4Images/4images/includes/page_header.php on line 116


die page_header.php sieht in dem Bereich folgendermaßen aus:

$result = $site_db->query_firstrow($sql);
$pms_new = "<a href=\"".$site_sess->url(ROOT_PATH."pms.php")."\">".(($result['new']) ? "<blink>".$result['new']."</blink>" : 0)."</a>";
$pms = preg_replace("/".$site_template->start."msg_new_count".$site_template->end."/siU", $pms_new, $lang['pms_link']);
$pms = preg_replace("/".$site_template->start."inbox".$site_template->end."/siU", "<a href=\"".$site_sess->url(ROOT_PATH."pms.php")."\">".$lang['pms_inbox']."</a>", $pms);
// PMS Boxes
$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 = ($result['new']) ? $blink."<span id=\"blnk\">".$lang['pms_inbox']."</span><script language=\"JavaScript\">blink();</script>" : $lang['pms_inbox'];
$inbox = "<a href=\"".$site_sess->url(ROOT_PATH."pms.php?action=inbox")."\" title=\"".$lang['pms_total']." (".$pms_inbox.")\">".$show_inbox."</a>";
$sentbox = "<a href=\"".$site_sess->url(ROOT_PATH."pms.php?action=sentbox")."\" title=\"".$lang['pms_total']." (".$pms_sentbox.")\">".$lang['pms_sentbox']."</a>";
$outbox = "<a href=\"".$site_sess->url(ROOT_PATH."pms.php?action=outbox")."\" title=\"".$lang['pms_total']." (".$pms_outbox.")\">".$lang['pms_outbox']."</a>;
$newpms = "<a href=\"".$site_sess->url(ROOT_PATH."pms.php?action=new")."\">".$lang['pms_new']."</a>";

$sql = "SELECT pms_date
                                    FROM ".PMS_TABLE."
                                    WHERE pms_to = ".$user_info['user_id']." AND pms_type = ".PMS_UNREAD."
                                    ORDER BY pms_date DESC";
$result = $site_db->query_firstrow($sql);
$pms_popup_script = "";
$pms_popup_header = "";
if ($result && $user_info['user_pms_popup'] && !ereg("pms.php", $self_url)) {
         $cookie_name = (defined("COOKIE_NAME")) ? COOKIE_NAME : "4images_";
         $cookie_pmsnewpopup = isset($HTTP_COOKIE_VARS[$cookie_name.'pmsnewpopup']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookie_name.'pmsnewpopup'])) : 0;
         $pmsnewpopup = (isset($session_info['pmsnewpopup'])) ? $session_info['pmsnewpopup'] : $cookie_pmsnewpopup;
         if ($pmsnewpopup < $result['pms_date']) {

Die fettgedruckte ist Zeile 116


Ich hoffe, Ihr könnt mir schnell helfen und danke euch schon mal im vorraus

Tarzan
Title: Re: [MOD] Private Message System (PMS) not supported anymore!
Post by: V@no on May 16, 2005, 02:50:39 AM
since this mod is not supported and obsolete, there is no point to continue discuss it.

Topic locked.
Title: Frage zum PMS
Post by: Pitt on June 27, 2005, 01:58:47 PM
Hallo rundrum,
ich habe mir die ältere Version des PMS eingebaut, kann mans noch irgendwo so umgestalten, dass beispielsweise unter eingeloggt als xxxx eine Meldung erscheint, wieviel neue Nachrichten in der Box sind?

Tnx im Voaus...
Pitt
Title: PMS mod Step by Step !!
Post by: hoho on April 02, 2007, 02:03:02 AM
Heloo.

Can somobodey post the code step by step for the PMS please.

Thankssssssssss!

HOHOH
Title: pm.php?action=new ???
Post by: hoho on April 05, 2007, 12:47:03 AM
Hy guys.

I have installed th PMS mod an when i get to make a new message i get this error

---------------------------------------------------------------------------------------------------------------------------------------------------------
Warning: Invalid argument supplied for foreach() in /www/htdocs/w008206a/pm.php on line 414

Fatal error: Call to undefined function: get_smiles_text() in /www/htdocs/w008206a/pm.php on line 427
---------------------------------------------------------------------------------------------------------------------------------------------------------

Why ?

Thanks !!
Thanks !!
Title: Re: pm.php?action=new ???
Post by: impss on April 05, 2007, 02:21:11 AM
You should post in the Orignal mods thread, not make a new post