collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 393
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

NEED HELP? If you're looking for support with Simple Portal, look no further than the Support Board!

Author Topic: Problem with Quick Pm only seen by admin  (Read 4845 times)

0 Members and 1 Guest are viewing this topic.

Offline boo2

  • Semi Newbie
  • *
  • Posts: 34
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Problem with Quick Pm only seen by admin
« on: September 19, 2012, 05:01:43 AM »
The topic for quick pm is a bit old, so I wasn't sure if I should address it there or start a new topic..

For some reason this block can only be seen by admin, no one else. I've been at this for hours, setting and resetting the permissions different ways and still no one but admin can see it. The message inside the box says: You are not allowed to access this block

Can someone help me with this? I really love how this works but it's not too much use if only admins can use it.

Here is the code:
Code: [Select]
/**
Quick PM modification by Dr. Deejay
Module originally created for Dream Portal
Ported to SimplePortal by Dr. Deejay
Version 1.0.2
Thanks to: SoLoGHoST, SlammedDime, Labradoodle-360, Ccbtimewiz, Miss all Sunday and DoctorMalboro     
*/
global $txt, $buttons, $scripturl, $smcFunc, $context;

$query = $smcFunc['db_query']('', '
SELECT real_name, id_member
FROM {db_prefix}members
WHERE is_activated={int:activated}
ORDER BY real_name ASC',
array(
'activated' => 1,
)
);

$context['fastpm']['members'] = array();

while ($row = $smcFunc['db_fetch_assoc']($query))
{
$context['fastpm']['members'][$row['id_member']] = $row['real_name'];
}

$smcFunc['db_free_result']($query);

// Wait.. We DO have permissions for it, or don't we?
if (!allowedTo('send_pm'))
{
echo 'You are not allowed to access this block';
return;
}

// Are we allowed to view the memberlist? If yes, begin with the select box
echo '<form action="#" method="post">
<select name="u">';
foreach ($context['fastpm']['members'] as $key => $value)
echo '<option value="', $key, '">', $value, '</option>';

echo ' </select>
<input type="submit" value="Send">
</form>';

// If we submitted the form, redirect to the messages section
if(isset($_POST['u']))
redirectexit('action=pm;sa=send;u=' . $_POST['u']);

« Last Edit: September 19, 2012, 05:15:07 AM by boo2 »
Using SMF 2.0.2 and Simple portal 2.3.5

Offline phantomm

  • Translator
  • *
  • Posts: 406
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: None
  • Elkarte Version: 1.0.5
Re: Problem with Quick Pm only seen by admin
« Reply #1 on: September 19, 2012, 09:42:35 AM »
hmm.. try change:
Code: [Select]
if (!allowedTo('send_pm')) to
Code: [Select]
if (!allowedTo('pm_send'))
Can you give link to topic with this code?

found it => http://simpleportal.net/index.php?topic=9406.0
« Last Edit: September 19, 2012, 11:49:03 AM by phantomm »

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Problem with Quick Pm only seen by admin
« Reply #2 on: September 19, 2012, 10:22:09 AM »
phantomm -- if you can test and confirm this for SMF 2.0.2/SimplePortal 2.3.5, can you submit this to the tracker, with fix?
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline phantomm

  • Translator
  • *
  • Posts: 406
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: None
  • Elkarte Version: 1.0.5
Re: Problem with Quick Pm only seen by admin
« Reply #3 on: September 19, 2012, 11:05:08 AM »
It works, but this is custom PHP code not built-in feature in SP :)

Offline boo2

  • Semi Newbie
  • *
  • Posts: 34
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Problem with Quick Pm only seen by admin
« Reply #4 on: September 19, 2012, 12:39:06 PM »
Sorry, was up all night trying to figure this thing out. Just woke up and didn't expect an answer quite so quickly. I see you found the link to where I found the code. Please forgive me for not thinking of that.

Yes that works like a charm. It also reminds me not to be so stubborn. I could have saved myself some hair pulling if I had just asked after the first couple of hours. LOL

Hard to believe that it was something this simple.

If I may ask just one more related question. Originally I put this code and another found here http://simpleportal.net/index.php?topic=9138.0 in the same block to save space and it worked beautifully just for admin of course. After several hours of not figuring out why it didn't work for others, I then put them in separate blocks and realized it was quick pm preventing the whole block from being seen by others.

With your fix I now have them both back in one block which makes it very convenient on the site. Is it ok to have more than one block of code in the same portal block? I mean it works but is there any reason why I shouldn't?

I am attaching how I have it in one block so you can see what I mean.

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

Just a suggestion, this quick pm is really quite useful, however as someone else said it could be a problem with hundreds of members which I DO NOT have, but hope to one day. It would be great if someone could change this a bit and have it only show contacts of that persons buddy list, so that at some point it doesn't become so long it's difficult to use. Hope that made sense. Or maybe there is another way to do it so that the drop down list of members would not become so long it would not longer be convenient.

I do appreciate you help Phantomm.

Using SMF 2.0.2 and Simple portal 2.3.5

Offline phantomm

  • Translator
  • *
  • Posts: 406
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: None
  • Elkarte Version: 1.0.5
Re: Problem with Quick Pm only seen by admin
« Reply #5 on: September 19, 2012, 12:53:27 PM »
If it works I don't see anything against it, but in my opinion it is more convenient to have in one block one custom PHP code, and if you want to save some space - just disable title for this block.

About suggestions related to Quick PM block, best place to post them is in topic where block was published => http://simpleportal.net/index.php?topic=9406.0 ;)

I'm glad that I could help :)

Offline boo2

  • Semi Newbie
  • *
  • Posts: 34
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Problem with Quick Pm only seen by admin
« Reply #6 on: September 19, 2012, 01:38:57 PM »
If it works I don't see anything against it, but in my opinion it is more convenient to have in one block one custom PHP code, and if you want to save some space - just disable title for this block.

About suggestions related to Quick PM block, best place to post them is in topic where block was published => http://simpleportal.net/index.php?topic=9406.0 ;)

I'm glad that I could help :)

Thanks Phantomm, I just posted over there.
Using SMF 2.0.2 and Simple portal 2.3.5

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Problem with Quick Pm only seen by admin
« Reply #7 on: September 20, 2012, 03:50:34 PM »
I'm glad that workd.

phantomm -- oops.  I was not reading carefully.  I hope Dr. Deejay will be able to incorporate your fix.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?