$Mybb Variable List
#11
(2015-03-03, 10:53 PM)Crazycat Wrote: Good thread idea, I suggest to add it in the official doc

Its not neccessary, I do have a plugin that displays some of this info for me on activation though:

<?php

if (!defined("IN_MYBB")) {
    die( "Access inside MyBB" );
}

$plugins->add_hook( "admin_config_plugin_begin", "show_globals_header_info" );

function show_globals_info() {
    return array(
        'name' => 'Show Global Information',
        'description' => 'Lists some global variable information.',
        'version' => '1.0',
        'compatibility' => '16*, 18*'
    );
}

function show_globals_activate() {
}

function show_globals_deactivate() {
}

function show_globals_header_info() {
    /* This info is shown at the top of the plugin
     * page in the admincp.
     * You can adjust this function for your needs,
     * but try not displaying too much as it is
     * a pain to scroll through.
     */
    global $mybb;
    echo '<span style="white-space: pre;">';
    echo '$mybb->user: ';
    print_r( $mybb->user );
    echo '$mybb->usergroup: ';
    print_r( $mybb->usergroup );
    echo '$mybb->settings: ';
    print_r( $mybb->settings );
    echo '</span>';
}

?>
Do NOT pm me for support on ANY of my plugins
DO pm me if you got suggestions for existing ones (although posting in the proper thread is preferred), or suggestions/ideas for new plugins (keep in mind I'm an amateur but not necessarily a beginner.)
Reply
#12
(2015-03-03, 11:19 PM)Ircher Wrote: Its not neccessary, I do have a plugin that displays some of this info for me on activation though:

Good idea, but imho, you'd better add a subsection in "Tools & Maintenance", under the "View PHP Info" entry.
[MyBB 1.8 mods] - Offer me a coffee
Do not ask me help through PM or Discord
Reply
#13
what's the variable that gets the number of posts made on the last 24 hours?
Owner of ForumAnime.PT
Reply
#14
(2016-03-01, 08:06 PM)Blackbeard Wrote: what's the variable that gets the number of posts made on the last 24 hours?

The same as the variable that gets number of users that rode monocycle last year. Non-existent until you define it. You'd need to look for a plugin that has it if you can't code it manually, basically a query for the count of posts older than TIME_NOW-24*3600 is required.
Reply
#15
(2016-03-02, 11:39 PM)Destroy666 Wrote:
(2016-03-01, 08:06 PM)Blackbeard Wrote: what's the variable that gets the number of posts made on the last 24 hours?

The same as the variable that gets number of users that rode monocycle last year. Non-existent until you define it. You'd need to look for a plugin that has it if you can't code it manually, basically a query for the count of posts older than TIME_NOW-24*3600 is required.

I didn't knew that there isn't one at that time. I figured it out already, thanks anyway @Destroy666.
Owner of ForumAnime.PT
Reply
#16
Is there a way to generate a random number whenever a template is called? like, I have this announcement template which is called depending on the amount of announcements it has, for instance, if it has 3 announcements, the template is called 3 times, and thus the code is repeated within that block. so I want a way to generate an unique number for that one instance, for instance if the template is called in the first time one number for the whole round, but in the next round the number is different. so Is there a variable in mybb to do what I want? Thanks.
Reply
#17
Not really sure what you mean by "a variable in mybb" - there wouldn't be a pre-defined variable for this specific use-case, no, but if this is a plugin, you can define whatever variables you want.
MyReactions - All Plugins

Can you still feel the butterflies?

Free never tasted like pudding.
Reply
#18
(2017-02-16, 01:07 PM)Matt Wrote: Not really sure what you mean by "a variable in mybb" - there wouldn't be a pre-defined variable for this specific use-case, no, but if this is a plugin, you can define whatever variables you want.

Thanks for the reply, I solved it with jquery, and js cookie.
https://github.com/js-cookie/js-cookie
Reply
#19
is there a way to fix regdate
Reply
#20
(2017-07-12, 08:21 AM)ketamine Wrote: is there a way to fix regdate

Why ask that in this thread? What does fixing the regdate even mean? It's a date, how is it broken?
My Plugins: [1.8]|[1.6]

** Selling custom plugin that enables Bitcoin payments. PM me if interested in purchasing! **
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)