Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

WelcomeToVanillaGetSomeAddons is this an admin only thing ?

edited September 2006 in Vanilla 1.0 Help
Can everyone see this or is it just the admin, was thinking of using it as an initial annoucement msg not to be confused with the annoucement extension

Comments

  • Its just admin, unless you want it to be otherwise....

    Here is an example of how to display a message for only those not signed in, along with an ad banner.

    If you change the if statement to check for ( $Context->Session-UserID > 0 ) , then it will only show for those signed in.
  • edited September 2006
    this appears to be the add notice code in index.php, could the above advice be added to this ? I tried it but page went blank, i want it to appear only for visitors not logged in // Remind them to get addons if this is a new install if ($Configuration['ADDON_NOTICE']) { if ($Context->Session->User && $Context->Session->User->Permission('PERMISSION_MANAGE_EXTENSIONS')) { $HideNotice = ForceIncomingBool('TurnOffAddonNotice', 0); if ($HideNotice) { $SettingsFile = $Configuration['APPLICATION_PATH'].'conf/settings.php'; $SettingsManager = $Context->ObjectFactory->NewContextObject($Context, 'ConfigurationManager'); $SettingsManager->DefineSetting("ADDON_NOTICE", '0', 1); $SettingsManager->SaveSettingsToFile($SettingsFile); } else { $NoticeCollector->AddNotice('<span><a href="'.GetUrl($Configuration, 'index.php', '', '', '', '', 'TurnOffAddonNotice=1').'">'.$Context->GetDefinition('RemoveThisNotice').'</a></span> '.$Context->GetDefinition('WelcomeToVanillaGetSomeAddons')); } } }
  • You would be better off adding the notice as an extension, that way when Vanilla is next updated, you don't have to re-do your changes:

    <?php /* Extension Name: Guest Notice Extension Url: www.lussumo.com/Add-ons/ Description: Adds a message for guests Version: 0.2 Author: WallPhone Author Url: http://wallphone.com */ if ( ($Context->Session->UserID == 0) && (in_array($Context->SelfUrl, array("index.php", "categories.php", "comments.php", "search.php", "post.php", "account.php", "settings.php"))) ){ $NoticeCollector->AddNotice('Please <a href="'.GetUrl($Configuration, 'people.php'). '">sign in</a> or <a href="'. GetUrl($Configuration, 'people.php', '', '', '', 'PostBackAction=ApplyForm'). '">apply for membership</a>.'); } ?>
  • why is this 'not to be confused with the announcement extension'? Doesnt it do the same job with less messing around?
  • edited September 2006
    annoucement can't be adjusted per user group I don't think at the moment, I wanted something for visitors mainly and when you login it disappears, this extension works perfect ;-) If announcement could be setup with a different annoucement message based on user group that would be excellent is there a way to add some css above the GuestNotice ? I tried to do a echo ' css '; above the $NoticeCollector->AddNotice( but it adds it way at the top of the page think i'm missing some extra coding, I also tried added it with the message but then it messes up the message style
This discussion has been closed.