Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

how to add 2 links to a piece of code which is actually in me.php

jackmaessenjackmaessen ✭✭✭
edited February 2016 in Vanilla 2.0 - 2.8

In the file applications/dashboard/views/modules/me.php there is this piece of code:

        if ($Session->checkPermission('Garden.Users.Approve')) {
            echo wrap(Anchor(sprite('SpApplicants').' '.t('Applicants').$CApplicant, '/dashboard/user/applicants'), 'li', array('class' => 'link-applicants'));
        }

        if ($Session->checkPermission(array('Garden.Settings.Manage', 'Garden.Moderation.Manage', 'Moderation.ModerationQueue.Manage'), false)) {
            echo wrap(Anchor(sprite('SpSpam').' '.t('Spam Queue').$CSpam, '/dashboard/log/spam'), 'li', array('class' => 'link-spam'));
        }

        if ($Session->checkPermission(array('Garden.Settings.Manage', 'Garden.Moderation.Manage', 'Moderation.ModerationQueue.Manage'), false)) {
            echo wrap(Anchor(sprite('SpMod').' '.t('Moderation Queue').$CModeration, '/dashboard/log/moderation'), 'li', array('class' => 'link-moderation'));
        }

        if ($Session->checkPermission(array('Garden.Settings.View', 'Garden.Settings.Manage'), false)) {
            echo wrap(Anchor(sprite('SpDashboard').' '.t('Dashboard'), '/dashboard/settings'), 'li', array('class' => 'link-dashboard'));
        }

This is the right place to add 2 links more to it:

echo Wrap(Anchor(Sprite('SpUpload').' '.T('Upload'), '/mods-upload'), 'li');
echo Wrap(Anchor(Sprite('SpOutbound').' '.T('Contact Outbound'), '/outbound-contact'), 'li');

But because it is a core file, i do not wnt to add these links here. How can i achieve the same reslut without modifying me.php?

Comments

  • Options
    phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP
    edited February 2016

    Hi jack,

    Copy the file and move it into a folder /views/modules/ inside your theme folder.

    Should look like that with the default theme:
    vanilla-root/themes/default/views/modules/me.php

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • Options

    this works great @phreak Thanks for the solution

  • Options
    phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP

    Nice! You're welcome.

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • Options

    You have a hook

    FlyoutMenu

    It is much better to use hooks rather then view overrides becuase of updates. Create a themehook file (search for examples) and put this method in your class.

    public function base_flyoutMenu_handler($sender) {
        // code goes here
    }
    

    grep is your friend.

  • Options

    Hi everyone, Can somebody help with this? How can I make a link a php file in html code? It will be write out the database entries. The php code works fine standalone but if I make a "a href" only a few parameters write out on the new html site. I'm confused....

Sign In or Register to comment.