コード例 #1
0
 public function theme($file_path, $data = 0, $output = true)
 {
     try {
         if (wt_is_writable(WT_PLUGIN_PATH . "dwoo/compiled/")) {
             global $_wt_options;
             $theme_path = wt_get_theme_path();
             $this->tpl = new Dwoo();
             if ($data) {
                 if ($this->file) {
                     $path = realpath($this->file);
                     $this->remove_file_path();
                 } else {
                     $path = realpath($this->path . '/' . $file_path);
                 }
                 if (file_exists($path)) {
                     if ($output) {
                         $this->tpl->output($path, $data);
                     } else {
                         return $this->tpl->get($path, $data);
                     }
                 } else {
                     echo "File Path <i>{$file_path}</i> doesnt exist, please add it to your theme library";
                 }
             }
         } else {
             throw new Exception("In order to display results, WordTour is using DWOO framework that requires write permission on folder <i>'" . WT_PLUGIN_PATH . "dwoo/compiled'</i>\n\t\t\t\t\tPlease set your permission level to read/write. contact your server administrator if WordPress is being hosted on a Windows server For Unix and Linux <a href='http://codex.wordpress.org/Changing_File_Permissions'>click here</a>");
         }
     } catch (Exception $e) {
         if (!wt_is_writable(WT_PLUGIN_PATH . "dwoo/compiled/")) {
             echo "<div class='error' style='background-color:#FFCCBF;padding:5px;border:1px solid #FF9980;'>An Error has Occurred<br/><i>" . $e->getMessage() . "</i></div>";
         }
     }
 }
コード例 #2
0
ファイル: handlers.php プロジェクト: Ashleyotero/oldest-old
function wt_get_default_theme_path()
{
    global $_wt_options;
    $path = wt_get_theme_path();
    return realpath($path . $_wt_options->options("default_theme"));
}