Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

How to add a link to the menu of the administration?

Asked Modified Viewed 2,405 times
D
djdandi
D
  • Senior Member, joined since
  • Contributed 298 posts on the community forums.
  • Started 99 threads in the forums
  • Started this discussions
asked
Senior Member

How to add a link to the menu of the administration?
Hi, how can I add a new link to navigate but the administrative department
eg.
infusions / news / news_admin.php ". $ aidlink."
djdandi attached the following file:
11_1.png [No information available / 121 Downloads]
0 replies

15 posts

F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

See user_info_panel.php, you have multiple macro shortcuts,

   echo strtr(ob_get_clean(), [
        '{%openside%}'             => open_side($locale['UM096'].$userdata['user_name']),
        '{%closeside%}'            => close_side(),
        '{%user_avatar%}'          => $info['user_avatar'],
        '{%user_name%}'            => $info['user_name'],
        '{%user_level%}'           => getuserlevel($info['user_level']),
        '{%user_reputation_icon%}' => $info['user_reputation_icon'],
        '{%user_reputation%}'      => $info['user_reputation'],
        '{%user_pm_notice%}'       => ($msg_count ? "<a href='".$info['user_pm_link']."' title='".$info['user_pm_title']."'><i class='fa fa-envelope-o'></i> $msg_count</a>" : ''),
        '{%user_pm_progressbar%}'  => $pm_progress,
        '{%user_nav_title%}'       => $locale['UM097'],
        '{%edit_profile_link%}'    => BASEDIR."edit_profile.php",
        '{%edit_profile_title%}'   => $locale['UM080'],
        '{%pm_link%}'              => BASEDIR."messages.php",
        '{%pm_title%}'             => $locale['UM081'],
        '{%track_link%}'           => $forum_exists ? INFUSIONS."forum_threads_list_panel/my_tracked_threads.php" : '',
        '{%track_title%}'          => $forum_exists ? $locale['UM088'] : '',
        '{%member_link%}'          => BASEDIR."members.php",
        '{%member_title%}'         => $locale['UM082'],
        '{%acp_link%}'             => (iADMIN ? ADMIN."index.php".fusion_get_aidlink()."&amp;pagenum=0" : ''),
        '{%acp_title%}'            => (iADMIN ? $locale['UM083'] : ''),
        '{%logout_link%}'          => BASEDIR."index.php?logout=yes",
        '{%logout_title%}'         => $locale['UM084'],
    ]);
0 replies
D
djdandi
D
  • Senior Member, joined since
  • Contributed 298 posts on the community forums.
  • Started 99 threads in the forums
  • Started this discussions
answered
Senior Member

But how can I use these shortcuts at the site add administration site_links
djdandi attached the following file:
12.png [No information available / 106 Downloads]
0 replies
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

use %% without brackets.
0 replies
D
djdandi
D
  • Senior Member, joined since
  • Contributed 298 posts on the community forums.
  • Started 99 threads in the forums
  • Started this discussions
answered
Senior Member

So it does not work
djdandi attached the following file:
13.png [No information available / 106 Downloads]
0 replies
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

I need to check it later then.
0 replies
D
djdandi
D
  • Senior Member, joined since
  • Contributed 298 posts on the community forums.
  • Started 99 threads in the forums
  • Started this discussions
answered
Senior Member

ok so I'm waiting.
0 replies
D
djdandi
D
  • Senior Member, joined since
  • Contributed 298 posts on the community forums.
  • Started 99 threads in the forums
  • Started this discussions
answered
Senior Member

It still does not work. How to add to the menu of the presence of administration, eg. To add news by admin
0 replies
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

%acp_link% should be in the url box , you tried acp_title, please read the definition list provided above.
0 replies
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

Ok, I was just told it won´t convert them. You must hardcode them links as in user_info_panel.php
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

I did not code acp link into site links.

Look. $info on v7.02.7
https://github.com/PHPFusion/PHPFusion/blob/7.02.07/themes/Atlantis/theme.php#L103-L114


function render_news($subject, $news, $info) {
global $locale;
opentable($subject);
echo "<div class='floatfix'>".$info['cat_image'].$news."</div>
<div class='news-footer'>
   ".newsposter($info," &middot;").newsopts($info,"&middot;").itemoptions("N",$info['news_id'])."
</div>\n";
closetable();
}


Familiar? That above is a template. It already is in V7. V6 even.

Now, if it were 9, you code like this:


/**
 * Version 9 - Atlantis
 * @param string $subject - not used accessible
 * @param string $news - not used accessible
 * @param array  $info - not used but accessible
 *
 * @return string
 */
function render_news($subject = '', $news = '', $info = array()) {
    $locale = fusion_get_locale();

    $html = open_table('{%subject%}')."
    <div class='floatfix'>{%cat_image%} {%news%}</div>
    <div class='news-footer'>
   {%news_poster%}
    </div>
    ".close_table();

    return (string) $html;
}


The difference here is in V7, the infusion load that function and doesn't need to echo it. That function echo itself.
In V9, the infusion simply returns a string, and the core will echo it.
This change is so that people look at v9 Template as HTML, not PHP.

That's the macro you're talking about. It's simply a container for variable exchange.

That macro will only exchange when I do this:


$template =  render_news($subject, $news, $info);
echo strtr( $template , array(
'{%subject%'}' => "News Example Title",
'{%cat_image%}' => "<img src='.......'>",
'{%news%}' => lorem_ipsum(1200),
'{%news_poster%}' => profile_link(1, 'Admin', 0),
));


Anything inside that template with that macro happens to be present, they will replace with that pair which the core logic calculates.

That is Template.

It has nothing to do with $aidlink.
0 replies
— 7 months later —
D
djdandi
D
  • Senior Member, joined since
  • Contributed 298 posts on the community forums.
  • Started 99 threads in the forums
  • Started this discussions
answered
Senior Member

I still do not know how to do this to add a link to the PA menu
This command in place of url% acp_link% does not work.
0 replies
— 1 month later —
D
djdandi
D
  • Senior Member, joined since
  • Contributed 298 posts on the community forums.
  • Started 99 threads in the forums
  • Started this discussions
answered
Senior Member

Hi, did this problem get fixed?
0 replies
R
Anonymous User
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions
answered
Veteran Member

https://github.com/PHPFusion/PHPFusion/commit/aafb649932f4ef331bf67d334c2ee747faafbac5
0 replies
D
djdandi
D
  • Senior Member, joined since
  • Contributed 298 posts on the community forums.
  • Started 99 threads in the forums
  • Started this discussions
answered
Senior Member

I updated it but it still does not work in admin menu I add as url
'{%acp_link%}'
{%acp_link%}
%acp_link%
0 replies
D
djdandi
D
  • Senior Member, joined since
  • Contributed 298 posts on the community forums.
  • Started 99 threads in the forums
  • Started this discussions
answered
Senior Member

ok thank you
administration/index.php%aidlink%&pagenum=0
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 15 posts
  • Votes 0 votes
  • Topic users 4 members

4 participants

F
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
C
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
D
D
  • Senior Member, joined since
  • Contributed 298 posts on the community forums.
  • Started 99 threads in the forums
  • Started this discussions
R
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet