Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 06:00 pm EDT

Geeklog Forums

Privmessages module & forum


Status: offline

kemal

Forum User
Regular Poster
Registered: 04/05/05
Posts: 103
Location:Turkey
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)
_KEMAL_
 Quote

Status: offline

romantaran

Forum User
Junior
Registered: 03/19/05
Posts: 34
Location:Russia
I have "send pm" link in userlist.php. Here is the code:
Text Formatted 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.
 Quote

Status: offline

romantaran

Forum User
Junior
Registered: 03/19/05
Posts: 34
Location:Russia
Exclamation 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:
Text Formatted Code
            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:
Text Formatted Code

                $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! Wink
 Quote

Status: offline

yankidank

Forum User
Junior
Registered: 04/03/05
Posts: 17
Can someone post a link to a working example of this so I can see what it would look like?
 Quote

Status: offline

romantaran

Forum User
Junior
Registered: 03/19/05
Posts: 34
Location:Russia
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.
 Quote

Status: offline

kemal

Forum User
Regular Poster
Registered: 04/05/05
Posts: 103
Location:Turkey
oh Shocked !!

very good Big Celebration

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

Status: offline

yankidank

Forum User
Junior
Registered: 04/03/05
Posts: 17
Very nice hack to integrate Privmessages into the forum. I give it my seal of approval romantaran. Thanks!
 Quote

Status: offline

romantaran

Forum User
Junior
Registered: 03/19/05
Posts: 34
Location:Russia
Exclamation Exclamation Exclamation
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:
Text Formatted Code
<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:
Text Formatted Code
<a href="{site_url}/privmessages/compose.php?to_uid={user_id}">Send</a>

 
 Quote

Status: offline

kemal

Forum User
Regular Poster
Registered: 04/05/05
Posts: 103
Location:Turkey
hi,

i upgrade my forum lastest version..

and privmessage hack is gone Rolling Eyes

can you make a hack again for new version praying it will work

Thanks...
_KEMAL_
 Quote

Status: offline

romantaran

Forum User
Junior
Registered: 03/19/05
Posts: 34
Location:Russia
I'll think of it. Banging your head
 Quote

Status: offline

romantaran

Forum User
Junior
Registered: 03/19/05
Posts: 34
Location:Russia
Well.Try this:

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

2. Replace with:
Text Formatted Code
$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:
Text Formatted Code
$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.
 Quote

Status: offline

kemal

Forum User
Regular Poster
Registered: 04/05/05
Posts: 103
Location:Turkey
great! Cool it's ok. Thanks..



but there is an another little error..

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


_KEMAL_
 Quote

Status: offline

romantaran

Forum User
Junior
Registered: 03/19/05
Posts: 34
Location:Russia
That is not the bug, that is the feature. Laughing Laughing
I'll correct it in the next version.
 Quote

Status: offline

kemal

Forum User
Regular Poster
Registered: 04/05/05
Posts: 103
Location:Turkey
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)
_KEMAL_
 Quote

Status: offline

romantaran

Forum User
Junior
Registered: 03/19/05
Posts: 34
Location:Russia
Quote by kemal: how can i remove or change privmesseages' backgorund color??

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.
 Quote

Status: offline

kemal

Forum User
Regular Poster
Registered: 04/05/05
Posts: 103
Location:Turkey
ok, my snapshoot is here.. This background colors only on gameserver thema may be error is game server but i couldn't find..
_KEMAL_
 Quote

Status: offline

romantaran

Forum User
Junior
Registered: 03/19/05
Posts: 34
Location:Russia
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.
 Quote

All times are EDT. The time is now 06:00 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content