dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse

This website has run out of funding so feel free to contribute if you can afford it (see footer)

Author Topic: SP Shoutbox PM Button  (Read 926 times)

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 6502
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:September 21, 2021, 08:21:42 AM
  • Deeply Confused Learner
  • Profession: IT Engineer
SP Shoutbox PM Button
« on: August 22, 2016, 10:29:59 PM »
http://simpleportal.net/index.php?topic=12338

SP Shoutbox PM Button

This mod will add sign @ before username in Shoutbox, and it will insert in message box something like this:

Code: [Select]
@UserName:
Now you can write some text after it :) It's just built in Shoutbox PM function, mod is just adding this button. Useful, because some users have complicated usernames

Message should be visible for author, for recipient and for admin.
Be aware, that PM function is built in in SimplePortal, this mod only adds button which allows to insert username in message box (with correct formatting for PM), nothing more.
« Last Edit: August 23, 2016, 05:40:16 PM by chipper »
friendly
0
funny
0
informative
0
agree
0
disagree
0
like
0
dislike
0
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
I do not condone or support any illegal activities. All information is for theoretical discussion and wonder.
All activities discussed are considered fictional and hypothetical. Information of all discussion has been derived from online research and in the spirit of personal Freedom.

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 6502
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:September 21, 2021, 08:21:42 AM
  • Deeply Confused Learner
  • Profession: IT Engineer
Re: SP Shoutbox PM Button
« Reply #1 on: May 02, 2018, 02:25:33 AM »
version 1.1 fixed some SMF patch issues and currently works with 2.0.15

package-info.xml

Code: [Select]
<?xml version="1.1"?>
<!DOCTYPE package-info SYSTEM "http://www.simplemachines.org/xml/package-info">
<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
<id>phantom:sp_shoutbox_pm_button</id>
<name>Shoutbox PM button - SimplePortal 2.3.6</name>
<version>1.1</version>

<install for="2.0 - 2.0.99">
<modification format="xml" type="file">install.xml</modification>
</install>

<uninstall for="2.0 - 2.0.99">
<modification format="xml" type="file" reverse="true">install.xml</modification>
<redirect type="inline" url="$scripturl?action=admin;area=packages">You are being automatically redirected to the Package Manager Page...</redirect>
</uninstall>
</package-info>

install.xml

Code: [Select]
<?xml version="1.1"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<id>phantom:sp_shoutbox_pm_button</id>
<name>Shoutbox PM button - SimplePortal 2.3.6</name>
<version>1.1</version>

<file name="$themedir/PortalShoutbox.template.php">
<operation>
<search position="replace"><![CDATA[<li class="smalltext">', !$shout['is_me'] ? '<strong>' . $shout['author']['link'] . ':</strong> ' : '', '<span style="word-wrap: break-word;overflow-y: auto;overflow-x: hidden;">' . $shout['text'], '</span><br /><span class="shoutbox_delete">', (!empty($shout['edit_link_js']) ? $shout['edit_link_js'] : '&nbsp;'), (!empty($shout['delete_link_js']) ? $shout['delete_link_js'] : '&nbsp;'), '</span><span class="smalltext shoutbox_time">', $shout['time'], '</span></li>';]]></search>
<add><![CDATA[<li class="smalltext">', !$shout['is_me'] ? '<a href="javascript:void(0);" title="'.$txt['sp_shoutbox_pm_title'].'" onclick="document.getElementById(\'new_shout_'. $shoutbox['id']. '\').value=\'@' . $shout['author']['name'] . ': \'">@</a><strong>' . $shout['author']['link'] . ':</strong> ' : '', '<span style="word-wrap: break-word;overflow-y: auto;overflow-x: hidden;">' . $shout['text'], '</span><br /><span class="shoutbox_delete">', (!empty($shout['edit_link_js']) ? $shout['edit_link_js'] : '&nbsp;'), (!empty($shout['delete_link_js']) ? $shout['delete_link_js'] : '&nbsp;'), '</span><span class="smalltext shoutbox_time">', $shout['time'], '</span></li>';]]></add>
</operation>

<operation>
<search position="replace"><![CDATA[ <author>', htmlspecialchars($shout['author']['link']), '</author>]]></search>
<add><![CDATA[ <author>', htmlspecialchars($shout['author']['link']), '</author>
<author_name>', htmlspecialchars($shout['author']['name']), '</author_name>
<author_name_txt>', $txt['sp_shoutbox_pm_title'] , '</author_name_txt>]]></add>
</operation>
</file>

<file name="$languagedir/SPortal.english.php">
<operation>
<search position="end"></search>
<add><![CDATA[$txt['sp_shoutbox_pm_title'] = 'Send Shoutbox PM';]]></add>
</operation>
</file>

<file name="$themedir/scripts/portal.js">
<operation>
<search position="replace"><![CDATA[, author,]]></search>
<add><![CDATA[, author, author_name, author_name_txt,]]></add>
</operation>

<operation>
<search position="replace"><![CDATA[ author = shout.getElementsByTagName("author")[0].childNodes[0].nodeValue;]]></search>
<add><![CDATA[ author = shout.getElementsByTagName("author")[0].childNodes[0].nodeValue;
author_name = shout.getElementsByTagName("author_name")[0].childNodes[0].nodeValue;
author_name_txt = shout.getElementsByTagName("author_name_txt")[0].childNodes[0].nodeValue;]]></add>
</operation>

<operation>
<search position="replace"><![CDATA[new_body += '<li class="smalltext">' + (is_me == 0 ? '<strong>' + author + ':</strong> ' : '') + content + '<br />' + (delete_link != 0 ? ('<span class="shoutbox_delete">' + delete_link + '</span>') : '') + (edit_link != 0 ? ('<span class="shoutbox_delete">' + edit_link + '</span>') : '') + '<span class="smalltext shoutbox_time">' + time + '</span></li>';]]></search>
<add><![CDATA[new_body += '<li class="smalltext">' + (is_me == 0 ? '<a href="javascript:void(0);" title="'+ author_name_txt +'" onclick="document.getElementById(\'new_shout_'+ shoutbox_id +'\').value=\'@' + author_name + ': \'">@</a><strong>' + author + ':</strong> ' : '') + content + '<br />' + (delete_link != 0 ? ('<span class="shoutbox_delete">' + delete_link + '</span>') : '') + (edit_link != 0 ? ('<span class="shoutbox_delete">' + edit_link + '</span>') : '') + '<span class="smalltext shoutbox_time">' + time + '</span></li>';]]></add>
</operation>
</file>
</modification>
« Last Edit: September 30, 2018, 03:53:00 PM by Chip »
friendly
0
funny
0
informative
0
agree
0
disagree
0
like
0
dislike
0
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
I do not condone or support any illegal activities. All information is for theoretical discussion and wonder.
All activities discussed are considered fictional and hypothetical. Information of all discussion has been derived from online research and in the spirit of personal Freedom.

Tags:
 


dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse





TERMS AND CONDITIONS

In no event will d&u or any person involved in creating, producing, or distributing site information be liable for any direct, indirect, incidental, punitive, special or consequential damages arising out of the use of or inability to use d&u. You agree to indemnify and hold harmless d&u, its domain founders, sponsors, maintainers, server administrators, volunteers and contributors from and against all liability, claims, damages, costs and expenses, including legal fees, that arise directly or indirectly from the use of any part of the d&u site.


TO USE THIS WEBSITE YOU MUST AGREE TO THE TERMS AND CONDITIONS ABOVE


Founded December 2014
SimplePortal 2.3.6 © 2008-2014, SimplePortal