Main Menu
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 log in.

Who's Online

  • Dot Guests: 1283
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

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]


Installation errors? Mod incompatibilities? Upgrade problems? Make your way over to the Install and Upgrade Support board for all your solutions!

Problem with Quick Pm only seen by admin

Started by boo2, September 19, 2012, 05:01:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

boo2

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: /**
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']);


Using SMF 2.0.2 and Simple portal 2.3.5

phantomm

#1
hmm.. try change: if (!allowedTo('send_pm')) to if (!allowedTo('pm_send'))

Can you give link to topic with this code?

found it => http://simpleportal.net/index.php?topic=9406.0

AngelinaBelle

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?

phantomm

It works, but this is custom PHP code not built-in feature in SP :)

boo2

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

phantomm

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 :)

boo2

Quote from: phantomm 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 :)

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

AngelinaBelle

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?