HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
caerostris - some changes - diff didn't display too well for me.
if it formats properly (which it didn't
class.van2shout.plugin.php add this $Position = (C('Plugin.Van2Shout.ContentAsset', "Content")); define('VAN2SHOUT_ASSETTARGET', $Position); remove this if(C('Plugin.Van2Shout.ContentAsset', true)) { define('VAN2SHOUT_ASSETTARGET', 'Content'); } else { define('VAN2SHOUT_ASSETTARGET', 'Panel'); } // add this to the Plugininfo array 'SettingsUrl' =>'/dashboard/settings/van2shout',
replaced functions and additional
public function Base_Render_Before($Sender) { if (C('Plugins.Van2Shout.Page', TRUE)) { $Sender->Menu->AddLink(T('Shoutpage'), T('Shoutpage'), 'van2shoutpage'); } $Controller = $Sender->ControllerName; $ShowOnController = array( 'profilecontroller', 'discussionscontroller' ); if (!InArrayI($Controller, $ShowOnController)) return; if(VAN2SHOUT_ASSETTARGET == 'Panel') { $this->includev2s($Sender); } } public function VanillaController_Van2ShoutPage_Create($Sender) { $Sender->ClearCssFiles(); $Sender->AddCssFile('style.css'); // render a normal vanilla page $Sender->MasterView = 'default'; // get the view to show $this->includev2s($Sender); $Sender->Render($this->GetView('van2shoutpage.php')); } public function DiscussionsController_Render_Before($Sender) { if(VAN2SHOUT_ASSETTARGET != 'Content') return; $this->includev2s($Sender); } public function Setup() { // add routing $matchroute = '^van2shoutpage(/.*)?$'; $target = 'vanilla/Van2ShoutPage$1'; if(!Gdn::Router()->MatchRoute($matchroute)) Gdn::Router()->SetRoute($matchroute,$target,'Internal'); $Construct = GDN::Structure(); $Construct->Table('Shoutbox'); if(!$Construct->TableExists()) { $Construct->PrimaryKey('ID') ->Column('UserName', 'varchar(50)') ->Column('PM', 'varchar(50)') ->Column('Content', 'varchar(150)') ->Column('Timestamp', 'int(11)') ->Set(FALSE, FALSE); } }
settings.php
from
<tr><td>Display on the discussions page</td><td><?php echo $this->Form->CheckBox('Plugin.Van2Shout.ContentAsset', ''); ?></t d></tr> to <tr> <td class="Alt"> <?php echo Gdn::Translate('Display position'); ?> </td> <td> <?php $Options = array('Panel' => 'Side', 'Content' => 'Center'); $Fields = array('TextField' => 'Code', 'ValueField' => 'Code'); echo $this->Form->DropDown('Plugin.Van2Shout.ContentAsset', $Options, $Fields); ?> </td> </tr>
after the changes disable plugin, enable plugin and goto settings and re-save.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
6
Comments
another change I use Plugins for config statements rather than Plugin
so I added this as well for the Separate Shout Page option in the settings.
$Schema['Plugins.Van2Shout.Page'] = array('LabelCode' => 'ShoutPage', 'Control' => 'Checkbox', 'Default' => C('Plugin.Van2Shout.Page', true));
and to settings
if you decide to go with Plugin.Van2Shout.Page instead of 'Plugins.Van2Shout.Page
obviously you need to change it everywhere in default.php and settings.php
all of the above changes.
'discussionscontroller' and the shoutbox page controllers. You could add others if you see fit.
I would zip it all and post, but i don't like to post whole files unless it is vanilla-made or the author is gone for over a year or two without logging, or I get permission from author (you). To me this is the proper way. So, careostris let me know if you want me to post zip.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
@peregrine is this about v1.053 (master)? It's not working for me.
maybe when caeorostis has time, he will test and add it to plugin if he sees fit.
Yes, and
its working for me since i tested before posting.
As always, I will gladly cut and paste and make edit for you 0@r0obert. Just send me a round-trip plane ticket with 1 day lodging at a luxury hotel at your server donation with a password and login name.
as noted here: http://vanillaforums.org/discussion/comment/210930/#Comment_210930
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
@careostris - since you said ok to post zip - here is a zip of the changed files.
after the changes are made the plugin must be enabled via the dashboard for routing to take place. and also some of the settings changed, so the dashboard settings for plugins would need to be selected and save for plugin as well.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
@karenr
If you pursue van2shout, as you mentioned in another thread.
if you disable the van2shout plugin via dashboard.
you theoretically should have the option to show the shoutbox in its own distinct page without it displaying on any other pages. (after you give the proper role permissions).
if it works for you, your feedback might be helpful.
if it doesn't work as expected, let me know.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Thanks! I need to do some stuff away from the screen for a while but I will most definitely pursue this soon and report back. I am so pleased with 2.1 that I am going to create one for my personal use and dump coppermine for personal shares with my family. Single sign on rules. As do you.
I just started working on a major code clean up.
The first bit of your changes has been implemented
Once I finished de-craping my old code I'll add stuff like the separate page.