Example #1
0
function hook($hook)
{
    // hooks stuff from plugins
    foreach (scandir(abspath . "/plugins") as $plugin) {
        if ($plugin != "." and $plugin != "..") {
            if (get_plugin_stuff($plugin, "active") == TRUE and in_array($hook, get_plugin_stuff($plugin, "hook"))) {
                if (is_dir(abspath . "/plugins/" . $plugin) and file_exists(abspath . "/plugins/" . $plugin . "/" . $plugin . ".php")) {
                    require_once abspath . "/plugins/" . $plugin . "/" . $plugin . ".php";
                } elseif (strrpos($plugin, ".php")) {
                    require_once abspath . "/plugins/" . $plugin;
                } elseif (strrpos($plugin, ".rb")) {
                    echo "<span class='ruby'>" . exec("ruby " . abspath . "/plugins/" . $plugin) . "</span>";
                } elseif (strrpos($plugin, ".js")) {
                    echo "<script src='" . get_blog_stuff("url") . "plugins/" . $plugin . "'></script>";
                }
            }
        }
    }
    // hooks stuff from from the theme
    include_once abspath . "/themes/" . $GLOBALS["theme"] . "/functions.php";
}
Example #2
0
            ?>
<div class='plugin item'><h4><?php 
            echo get_plugin_stuff($plugin, "name");
            ?>
</h4><a href='editor.php?type=plugin&file=<?php 
            echo $plugin;
            ?>
'>Edit</a> <strong>Author: </strong> <a href='<?php 
            echo get_plugin_stuff($plugin, "author_uri");
            ?>
'><?php 
            echo get_plugin_stuff($plugin, "author");
            ?>
</a> <strong>desc:</strong> <?php 
            echo get_plugin_stuff($plugin, "desc");
            ?>
 <strong>Version:</strong> <?php 
            echo get_plugin_stuff($plugin, "version");
            ?>
 <strong>Active:</strong> <?php 
            if (get_plugin_stuff($plugin, "active")) {
                echo "Active!";
            } else {
                echo "Not active.";
            }
            ?>
</div><?php 
        }
    }
}
include_once 'footer.php';