MyBB Community Forums

Full Version: How to: Use PHP to generate a link (list) to every page in the ACP?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Please help with general ideas, and I'll eventually post the full code, or if someone has the time, please post the full code:
  • How to: Use PHP to generate a link (list) to every page in the ACP?

Final Output == A long list like this with each page title having a link to the ACP page
...
Themes - Create New Theme
Themes - Import a Theme
....
Board Settings - Add New Setting
Board Settings - Add New Setting Group


##
Ideas / questions to get started:
  1. How to search (crawl) the admin section to gather all the data? Smile
  2. To keep it 'simple', let's assume the admin's browser is already logged into the ACP.
  3. I know I can do the "output code" (PHP to html), but having the exact details (using the array, looping through the data, etc) will save time (or else I'll post later)
Thank you
I could not understand the purpose of all links listing from admin panel ...
$excluded = array(
     "global.php",
);
echo "<ul>";
foreach(glob(MYBB_ROOT."*.php") as $f){
     $f = str_replace(MYBB_ROOT,"",$f);
     if(!in_array($f,$excluded)){
          echo "<li><a href=\"{$mybb->settings['bburl']}/{$f}\">{$f}</a></li>
     }
}
echo "</ul>";

Then just add any files you don't want to show to the $exclude array.

This would be a decent base for what you are wanting.

NOTE: This hasn't been tested, and may or may not work.
^ well, above is for directory listing . AND requirement is different !!
I think a bot would be overkill for this, just sift through the ACP templates.

All the best,
Imad Jomaa

w
(2011-10-30, 04:30 PM)Imad Jomaa Wrote: [ -> ]I think a bot would be overkill for this, just sift through the ACP templates.

All the best,
Imad Jomaa

w

Thanks for the idea. How would you filter out the many templates that do not create a whole page / URL?
Edit: Oops, dumb question, the ACP doesn't have many "sub-templates" compared to the front-end.
The ACP doesn't have any templates :p
(2011-10-30, 07:05 PM)Booher Wrote: [ -> ]The ACP doesn't have any templates :p

Indeed. Just ignore what I said, I was thinking of something else.

e