Changeset 535156
- Timestamp:
- 04/23/2012 05:48:42 PM (14 years ago)
- Location:
- wpmathpublisher/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (3 diffs)
-
wpmathpublisher.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpmathpublisher/trunk/readme.txt
r221131 r535156 3 3 Tags: math, post, equation, formula 4 4 Requires at least: 2.5 5 Tested up to: 2.8.66 Stable tag: 0.6. 3.15 Tested up to: 3.3.1 6 Stable tag: 0.6.4 7 7 8 8 Plugin that allows formulars to be included in blog texts (as graphics) … … 45 45 * German (translated by me) 46 46 * Belorussian (by [Marcis G](http://pc.de/ "Marcis G.")) 47 * Romanian (by [Web Hosting Geeks](http://webhostinggeeks.com/ "Web Geek Sciense") 47 48 48 49 == Changelog == 49 50 = v 0.6.4 [2012-04-19] 51 * fixed activation problem 52 * fixed tinyMCE integration (language issue) 53 * added romanian translation (since this update not complete) by Alexander Ovsov [ http://webhostinggeeks.com/ ] 50 54 = v 0.6.3.1 [2010-03-23] = 51 55 * fixed things this f*cking svn gui messed with … … 100 104 1. Upload the extracted folder, including all subfolders (no matter if empty or not) to the plugin directory of your wordpress installation (/wp-content/plugins/) 101 105 1. Activate the plugin in your wordpress administration center 102 1. If necessary (script will tell you) , create the folder "img" as subdirectory of the wpmathpublisher directory and set it to chmod 777106 1. If necessary (script will tell you), create the folder "img" as subdirectory of the wpmathpublisher directory and set it to chmod 777 103 107 1. Done. Go for it! 104 108 -
wpmathpublisher/trunk/wpmathpublisher.php
r221131 r535156 2 2 /* 3 3 Plugin Name: WpMathPublisher 4 Plugin URI: http:// blog.kraeuterbruederchen.de5 Description: Allows to include formulas written for <a href="http://www.xm1math.net/phpmathpublisher/" title="PhpMathPublisher">PhpMathPublisher</a>. Formulas have to be put into [m ][/m] - tags. For formula information visit: <a href="http://www.xm1math.net/phpmathpublisher/doc/help.html" title="PhpMathPublisher - Help">PhpMathPublisher-Page</a>4 Plugin URI: http://devblog.kraeuterbruederchen.de/2012/04/wpmathpublisher-2/ 5 Description: Allows to include formulas written for <a href="http://www.xm1math.net/phpmathpublisher/" title="PhpMathPublisher">PhpMathPublisher</a>. Formulas have to be put into [math][/math] - tags. For formula information visit: <a href="http://www.xm1math.net/phpmathpublisher/doc/help.html" title="PhpMathPublisher - Help">PhpMathPublisher-Page</a> 6 6 Author: Timm Severin 7 7 Author URI: http://kraeuterbruederchen.de … … 56 56 ! fixed things this f*cking svn gui messed with 57 57 ! woring up to Wordpress 2.8.6 58 v 0.6.4 [2012-04-23] 59 ! fixed activation problem 60 ! fixed tinyMCE integration (language issue) 61 + added romanian translation (since this update not complete) by Alexander Ovsov [ http://webhostinggeeks.com/ ] 62 ! updated german translations 58 63 59 64 Roadmap: … … 77 82 define('WPMP_BASEURL', WP_PLUGIN_URL.'/'.WPMP_FOLDER); 78 83 84 # Admin-Interface output function 85 function trigger_message($message, $errno) { 86 if(isset($_GET['action']) && $_GET['action'] == 'error_scrape') { 87 echo '<div style="font-size: 8pt; font-family: Tahoma;">' . $message . '</div>'; 88 exit; 89 } else { 90 trigger_error($message, $errno); 91 } 92 } 93 79 94 ## get other constants 80 95 include_once('constants.php'); … … 97 112 // constructor for later php versions 98 113 function __construct() { 99 // get path for saving images - create if necessary114 // get path for saving images 100 115 $imgDir = WPMP_BASEDIR.'/img/'; 101 if(!is_dir($imgDir) && !mkdir($imgDir))116 if(!is_dir($imgDir)) 102 117 $this->ready = false; 103 118 if(!is_writeable($imgDir)) 104 119 $this->ready = false; 105 106 120 107 121 $this->imgPath = WPMP_BASEURL.'/img/'; 108 122 … … 149 163 ## activation / deactivation 150 164 function activate() { 165 $message = ''; $failed = false; 151 166 if(!is_dir(WPMP_BASEDIR.'/img/')) { 152 if(!mkdir(WPMP_BASEDIR.'/img/', 0777)) { 153 deactivate_plugins(basename(__FILE__)); // Deactivate itself 167 $message .= 'Image directory does not exist. Trying to create it...'; 168 if((substr(sprintf('%o', fileperms(WPMP_BASEDIR)), -4) != "0777") or (!@mkdir(WPMP_BASEDIR.'/img/', 0777))){ 169 $message .= 'creating failed, permission denied. Please do the following steps manually:'; 170 $message .= ' 171 <ol> 172 <li>Use a FTP-Client to access your wordpress installation and go to the WpMathPublisher-Plugin directory ('.WPMP_BASEDIR.')</li> 173 <li>Create a subdirectory "img"</li> 174 <li>Grant full write access to the image directory (<i>chmod 777</i>)</li> 175 </ol> 176 '; 177 // seems not to be necessary 178 #deactivate_plugins(basename(__FILE__)); // Deactivate itself 179 180 $failed = true; 181 } else { 182 $message .= 'succesfull'; 154 183 } 155 } elseif(!chmod(WPMP_BASEDIR.'/img/')) { 156 deactivate_plugins(basename(__FILE__)); // Deactivate itself 157 } 158 159 $font = get_option('wpmathpublisher_font'); 160 $back = get_option('wpmathpublisher_back'); 161 if(isset($font['red'])) { 162 ## convert old values 184 } elseif(substr(sprintf('%o', fileperms(WPMP_BASEDIR.'/img/')), -4) != "0777") { 185 $message .= 'Permission to write to image directory has been denied. Trying to set permissions...'; 186 if((substr(sprintf('%o', fileperms(WPMP_BASEDIR)), -4) != "0777") or (!@chmod(WPMP_BASEDIR.'/img/', 0777))){ 187 $message .= 'failed to set permissions. Please do the following steps manually:'; 188 $message .= ' 189 <ol> 190 <li>Use a FTP-Client to access your wordpress installation and go to the WpMathPublisher-Plugin directory ('.WPMP_BASEDIR.')</li> 191 <li>Grant full write access to the image directory (<i>chmod 777</i>)</li> 192 </ol> 193 '; 194 // seems not to be necessary 195 #deactivate_plugins(basename(__FILE__)); // Deactivate itself 196 $failed = true; 197 } else { 198 $message .= 'successfull'; 199 } 200 } 201 if(!empty($message)) { trigger_message($message, E_USER_ERROR); } 202 if($failed) { exit; } 203 204 ## Check if update or newly installed 205 if(get_option('wpmathpublisher_font') === false) { 206 ## new installation, setup default values 207 add_option('wpmathpublisher_font', array('color' => '000000', 'alpha' => 0)); 208 add_option('wpmathpublisher_back', array('color' => 'ffffff', 'alpha' => 0)); 209 add_option('wpmathpublisher_size', 12); 210 } elseif(isset($font['red'])) { 211 ## UPDATE, convert old values (earlier versions) 163 212 $fontColor = $this->convertRgbToHex($font); 164 213 update_option('wpmathpublisher_font', array('color' => $fontColor, 'alpha' => $font['alpha'])); 165 214 $backColor = $this->convertRgbToHex($back); 166 215 update_option('wpmathpublisher_back', array('color' => $backColor, 'alpha' => $back['alpha'])); 167 168 $this->clearCache(); 169 $this->readOptions(); 170 } 171 172 add_option('wpmathpublisher_font', $this->font); 173 add_option('wpmathpublisher_back', $this->back); 174 add_option('wpmathpublisher_size', $this->size); 216 } else { 217 ## no changes necessary 218 } 175 219 } 176 220 177 221 function deactivate() { 222 # clear database 178 223 delete_option('wpmathpublisher_font'); 179 224 delete_option('wpmathpublisher_back'); 180 225 delete_option('wpmathpublisher_size'); 181 226 182 $this->clearCache(); 227 # clean filesystem 228 self::clearCache(); 229 230 ## delete image-directory if possible // not executed, why? 231 #if(substr(sprintf('%o', fileperms(WPMP_BASEDIR)), -4) == "0777") 232 # rmdir(WPMP_BASEDIR.'/img'); 183 233 } 184 234 … … 265 315 266 316 ## function to delete all images in cache 267 function clearCache() {317 static function clearCache() { 268 318 $basePath = WPMP_BASEDIR.'/img'; 269 319 … … 299 349 $myWpMathPublisher =& new WpMathPublisher; 300 350 301 // Create data/clean up302 register_activation_hook(__FILE__, array( $myWpMathPublisher, 'activate'));303 //register_deactivation_hook(__FILE__, array($myWpMathPublisher, 'deactivate'));351 // Create data/clean up 352 register_activation_hook(__FILE__, array('WpMathPublisher', 'activate')); 353 register_deactivation_hook(__FILE__, array('WpMathPublisher', 'deactivate')); 304 354 305 355 add_action('init', array($myWpMathPublisher, 'init'));
Note: See TracChangeset
for help on using the changeset viewer.