Subject: Privmessages module & forum

Posted on: 29/09/05 05:04am
By: kemal

Hi,

how can i activate to "pm" on forum..sanpshoot is here

and how can i activate to "send pm" on profiles ( like send mail)

Privmessages module & forum

Posted on: 29/09/05 06:48am
By: romantaran

I have "send pm" link in userlist.php. Here is the code:
<?php

/* Reminder: always indent with 4 spaces (no tabs). */
// +---------------------------------------------------------------------------+
// | Geeklog 1.3                                                               |
// +---------------------------------------------------------------------------+
// | userlist.php                                                              |
// | Lists the registered users of a Geeklog site.                             |
// |                                                                           |
//
// You can change the number of users displayed per page by adjusting the
// value $limit = 50; below accordingly ...

require_once ("lib-common.php");

function listusers($curpage)
{       global $_TABLES, $_CONF, $LANG01, $LANG04;

    $limit = 50; // this is the number of users listed per page

    $retval = COM_startBlock($LANG01[17]);

    $retval .= ' <table width="100%" border="0">' . LB;
    $retval .= '<tr><td><b>' . $LANG04[2] . '</b></td><td><B>Ôîòî</B></td><td><b>' . $LANG04[3] . '</b></td></tr>' . LB;

    $num_pages = ceil(DB_getItem($_TABLES['users'],'count(*)','uid > 1') / $limit);
    $offset = ($curpage - 1) * $limit;

    $sql = "SELECT uid,username,fullname,email,photo FROM {$_TABLES['users']} WHERE uid > 1 LIMIT $offset,$limit";
    $result = DB_query($sql);
    $nrows = DB_numRows($result);

    for ($i = 0; $i < $nrows; $i++) {
        $A = DB_fetchArray($result);
        $retval .= '<tr><td><a href="' . $_CONF['site_url']
                . '/users.php?mode=profile&uid=' . $A['uid'] . '">'
                . $A['username'] . '</a></td><td valign="bottom">';
        if (!empty($A['photo']) AND $_CONF['allow_user_photo'] == 1) {
            $retval .= ' <a href="' . $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid'] . '"><img src="' . $_CONF['layout_url'] . '/images/smallcamera.gif" border="0" alt=""></a>';
        }
        $retval .= '</td><td>' . $A['fullname']
                . '</td><td><a href="' . $_CONF['site_url']
                . '/profiles.php?uid=' . $A['uid']
                . '">' . $LANG04[81] .'</a></td><td><a href="privmessages/compose.php?to_uid=' . $A['uid'] . '">Private message</a></td></tr>' . LB;
    }

    $retval .= '</table>' . LB;

    if ($num_pages > 1) {
        $retval .= '<p>' . COM_printPageNavigation ($PHP_SELF, $curpage, $num_pages) . '</p>';
    }

    $retval .= COM_endBlock();

    return $retval;
}

// MAIN

$display = COM_siteHeader ('menu');

if (empty ($_USER['username'])) { // prevent anon users from viewing the list

  /* The following will only work in Geeklog 1.3.6rc1 and up
    $display .= COM_startBlock($LANG_LOGIN[1]);
    $login = new Template($_CONF['path_layout'] . 'submit');
    $login->set_file (array ('login'=>'submitloginrequired.thtml'));
    $login->set_var ('login_message', $LANG_LOGIN[2]);
    $login->set_var ('site_url', $_CONF['site_url']);
    $login->set_var ('lang_login', $LANG_LOGIN[3]);
    $login->set_var ('lang_newuser', $LANG_LOGIN[4]);
    $login->parse ('output', 'login');
    $display .= $login->finish ($login->get_var('output'));
    $display .= COM_endBlock();
  */

    // poor man's solution for Geeklog up to 1.3.5sr2
    $display .= COM_startBlock($LANG04[21]);
    $display .= 'Sorry, to view the list of members of this site, you need to be a member yourself. Please register or log in.';
    $display .= COM_endBlock();

} else {
    if (empty($page)) {
        $page = 1;
    }
    $display .= listusers($page);
}

$display .= COM_siteFooter ();
echo $display;

?>




Create userlist.php with this code, place it in public_html directory and place somewhere a link to this file.

Privmessages module & forum

Posted on: 03/10/05 11:15am
By: romantaran

To activate "pm" button on forum with the Privmessages module you can do a little hack.
1. Open: public_html/forum/include/gf_showtopic.php
2. Find:
            if (function_exists(msg_send)) {
               $pm_link = 'HREF="' .$_CONF['site_url'] . '/messenger/index.php?action=newpm&toname=' . $showtopic['name'] . ';">';
                $pm_linkimg = '<img src="' .$imgset. '/pm.gif" border="0" align="absmiddle" alt="' .$LANG_GF01['PMLink']. '" TITLE="'.$LANG_GF01['PMLink'].'">';
                $topictemplate->set_var ('pmlink', $pm_link);
                $topictemplate->set_var ('pmlinkimg', $pm_linkimg);
                $topictemplate->set_var ('LANG_pm', $LANG_GF01['PMLink']);
            }




3. Replace it with:
                $pm_link = 'HREF="' .$_CONF['site_url'] . '/privmessages/compose.php?to_uid=' . $showtopic['uid'] . '">';
                $pm_linkimg = '<img src="' .$imgset. '/pm.gif" border="0" align="absmiddle" alt="' .$LANG_GF01['PMLink']. '" TITLE="'.$LANG_GF01['PMLink'].'">';
                $topictemplate->set_var ('pmlink', $pm_link);
                $topictemplate->set_var ('pmlinkimg', $pm_linkimg);
                $topictemplate->set_var ('LANG_pm', $LANG_GF01['PMLink']);



4. Send privmessages!

Privmessages module & forum

Posted on: 03/10/05 12:19pm
By: yankidank

Can someone post a link to a working example of this so I can see what it would look like?

Privmessages module & forum

Posted on: 03/10/05 01:25pm
By: romantaran

Look at it in my site: http://eikon.org.ru. But it's avialable only for registered users. You can send pm for "user" or "Ðîìàí", maybe I'll send a reply.

Privmessages module & forum

Posted on: 04/10/05 12:54pm
By: kemal

oh !!

very good

by this way we don't need premium plugins!!!

Privmessages module & forum

Posted on: 04/10/05 06:05pm
By: yankidank

Very nice hack to integrate Privmessages into the forum. I give it my seal of approval romantaran. Thanks!

Privmessages module & forum

Posted on: 05/10/05 01:38am
By: romantaran


The easiest way to add "send private message" link to user's profile!
For "Professional" theme. Replace public_html/layout/professional/users/profile.thtml file with the file in archive.

You can make a similar in your theme. I've just added to the profile.thtml the following line:
<tr valign="top"> <td align="right"><b>Private message:</b></td><td><a href="{site_url}/privmessages/compose.php?to_uid={user_id}">Send</a></td> </tr>



The main thing is the link:
<a href="{site_url}/privmessages/compose.php?to_uid={user_id}">Send</a>


Privmessages module & forum

Posted on: 11/11/05 11:52am
By: kemal

hi,

i upgrade my forum lastest version..

and privmessage hack is gone

can you make a hack again for new version

Thanks...

Privmessages module & forum

Posted on: 11/11/05 04:02pm
By: romantaran

I'll think of it.

Privmessages module & forum

Posted on: 11/11/05 04:58pm
By: romantaran

Well.Try this:

1. Open forum/memberlist.php. Find
$pm_link = "href="{$pmplugin_link}">";

2. Replace with:
$pm_link = "href=\"{$_CONF['site_url']}/privmessages/compose.php?to_uid={$siteMembers['uid']}\">";




3. Open forum/include/gf_showtopic.php. Find
$pm_link = "href="{$pmplugin_link}">";

4. Replace with:
$pm_link = "href=\"{$_CONF['site_url']}/privmessages/compose.php?to_uid={$showtopic['uid']}\">";





I don't have new forum installed and I don't tested this hack. I just looked into the code. Tell me if it doesn't work.

Privmessages module & forum

Posted on: 12/11/05 10:40am
By: kemal

great! it's ok. Thanks..



but there is an another little error..

if i change my langluage, privmessages' langluage not changing ..


Privmessages module & forum

Posted on: 12/11/05 01:57pm
By: romantaran

That is not the bug, that is the feature.
I'll correct it in the next version.

Privmessages module & forum

Posted on: 09/01/06 11:22am
By: kemal

hi,

how can i remove or change privmesseages' backgorund color??

And how can i make advanced editor for compose (like geeklog's story editor 1.4..0.rc1)

Privmessages module & forum

Posted on: 10/01/06 05:20pm
By: romantaran

[QUOTE BY= kemal] how can i remove or change privmesseages' backgorund color??[/QUOTE]
What background color? Can you post or send me a screenshot?

[QUOTE= kemal]And how can i make advanced editor for compose (like geeklog's story editor 1.4..0.rc1)[/QUOTE]
Give me some days to think.

Privmessages module & forum

Posted on: 19/01/06 10:10pm
By: kemal

ok, my snapshoot is here.. This background colors only on gameserver thema may be error is game server but i couldn't find..

Privmessages module & forum

Posted on: 20/01/06 01:16pm
By: romantaran

Colors of the table you can change in config.php:

$table_color = array(
1 => '#efefef',
2 => '#dee3e7',
3 => '#c7d0d7',
);

As to your question about advanced editor - it seems to me it is not possible to use geeklog's rich text editor in privmessages module. Probably I'll find an alternative.

Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=58205