Changeset 246
- Timestamp:
- 10/03/08 16:49:39 (15 years ago)
- Location:
- plugins/authorMode
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/authorMode/_admin.php
r217 r246 10 10 # 11 11 # -- END LICENSE BLOCK ------------------------------------ 12 if (!defined('DC_CONTEXT_ADMIN')) { return; } 13 12 14 require_once dirname(__FILE__).'/_widgets.php'; 13 15 … … 23 25 $core->addBehavior('adminBeforeUserUpdate',array('authorModeBehaviors','adminBeforeUserUpdate')); 24 26 25 class authorModeBehaviors {26 27 class authorModeBehaviors 28 { 27 29 public static function adminBeforeUserUpdate(&$cur,&$user_id = '') 28 30 { 29 31 $cur->user_desc = $_POST['user_desc']; 30 32 } 31 32 33 33 34 public static function adminAuthorHeaders() 34 35 { … … 37 38 dcPage::jsLoad('index.php?pf=authorMode/_user.js'); 38 39 } 39 40 40 41 public static function adminAuthorForm(&$rs) 41 42 { … … 49 50 elseif ($rs instanceof record && $rs->exists('user_desc')) {$user_desc = $rs->user_desc;} 50 51 else $user_desc = ''; 51 52 52 53 echo 53 54 '<fieldset class="clear"><legend>'. -
plugins/authorMode/_define.php
r217 r246 10 10 # 11 11 # -- END LICENSE BLOCK ------------------------------------ 12 if (!defined('DC_RC_PATH')) { return; } 12 13 13 14 $this->registerModule( … … 15 16 /* Description*/ "post entries per author + author desc handling", 16 17 /* Author */ "xave", 17 /* Version */ '1.2. 1',18 /* Version */ '1.2.2', 18 19 /* Permissions */ 'admin,contentadmin' 19 20 ); -
plugins/authorMode/_prepend.php
r217 r246 10 10 # 11 11 # -- END LICENSE BLOCK ------------------------------------ 12 if (!defined('DC_RC_PATH')) { return; } 13 12 14 $core =& $GLOBALS['core']; 13 15 14 16 class rsAuthor 15 { 17 { 16 18 public static function getAuthorCN(&$rs) 17 19 { … … 38 40 return $rs->user_email; 39 41 } 40 } 42 } 41 43 42 if ($core->blog->settings->authormode_active) 44 if ($core->blog->settings->authormode_active) 43 45 { 44 46 if ($core->blog->settings->authormode_url_author !== null) { -
plugins/authorMode/_public.php
r217 r246 10 10 # 11 11 # -- END LICENSE BLOCK ------------------------------------ 12 if (!defined('DC_RC_PATH')) { return; } 13 if (!$core->blog->settings->authormode_active) { return; } 14 12 15 require_once dirname(__FILE__).'/_widgets.php'; 13 16 … … 38 41 $args = func_get_args(); 39 42 array_shift($args); 40 43 41 44 if ($args[0] == 'Comments') { 42 45 $p = … … 83 86 $p = '$params = array();'."\n".$p; 84 87 } 85 88 86 89 $res = 87 90 "<?php\n". … … 95 98 return $res; 96 99 } 97 100 98 101 public static function AuthorsHeader($attr,$content) 99 102 { … … 118 121 'echo $_ctx->users->user_desc;'."\n". 119 122 "?>\n"; 120 123 121 124 return $res; 122 125 } 123 126 124 127 public static function AuthorPostsURL($attr) 125 128 { … … 129 132 "/".$_ctx->users->user_id').'; ?>'; 130 133 } 131 134 132 135 public static function AuthorNbPosts($attr) 133 136 { … … 136 139 } 137 140 138 141 139 142 public static function AuthorCommonName($attr) 140 143 { … … 166 169 return '<?php echo '.sprintf($f,'$_ctx->users->user_id').'; ?>'; 167 170 } 168 171 169 172 public static function AuthorEmail($attr) 170 173 { … … 189 192 return '<?php echo '.sprintf($f,'$_ctx->users->user_url').'; ?>'; 190 193 } 191 194 192 195 public static function AuthorFeedURL($attr) 193 196 { … … 202 205 'rawurlencode($_ctx->users->user_id)."/'.$type.'"').'; ?>'; 203 206 } 204 205 207 } 206 208 207 209 208 210 class urlAuthor extends dcUrlHandlers … … 219 221 } 220 222 $GLOBALS['_ctx']->users = authormodeUtils::getPostsUsers($args); 221 223 222 224 if ($GLOBALS['_ctx']->users->isEmpty()) { 223 225 self::p404(); 224 226 } 225 227 226 228 self::serveDocument('author.html'); 227 229 } … … 232 234 { 233 235 $GLOBALS['_ctx']->users = authormodeUtils::getPostsUsers($args); 234 236 235 237 if ($GLOBALS['_ctx']->users->isEmpty()) { 236 238 self::p404(); 237 239 } 238 240 239 241 self::serveDocument('authors.html'); 240 242 exit; 241 243 } 242 244 243 245 public static function feed($args) 244 246 { … … 261 263 self::p404(); 262 264 } 263 265 264 266 if ($type == 'atom') { 265 267 $mime = 'application/atom+xml'; … … 282 284 { 283 285 global $core; 284 286 285 287 if ($params !== null && is_string($params)) { 286 288 $params = array('author' => $params); 287 289 } 288 290 289 291 $strReq = 290 292 'SELECT P.user_id, user_name, user_firstname, '. … … 294 296 "WHERE blog_id = '".$core->con->escape($core->blog->id)."' ". 295 297 'AND P.post_status = 1 '; 296 298 297 299 if (!empty($params['author'])) { 298 300 $strReq .= … … 309 311 " AND P.post_type = 'post' "; 310 312 } 311 313 312 314 $strReq .= 313 315 'GROUP BY P.user_id, user_name, user_firstname, user_displayname, user_desc '; 314 316 315 317 if (!empty($params['order'])) { 316 318 $strReq .= … … 322 324 'ORDER BY user_displayname, user_firstname, user_name '; 323 325 } 324 326 325 327 try 326 328 { -
plugins/authorMode/_widgets.php
r217 r246 10 10 # 11 11 # -- END LICENSE BLOCK ------------------------------------ 12 if (!defined('DC_RC_PATH')) { return; } 13 12 14 $core->addBehavior('initWidgets',array('widgetsAuthorMode','init')); 13 15 … … 44 46 return $res; 45 47 } 46 47 48 48 49 public static function init(&$w) 49 50 { -
plugins/authorMode/index.php
r217 r246 22 22 { 23 23 $core->blog->settings->setNameSpace('authormode'); 24 24 25 25 $active = (empty($_POST['active']))?false:true; 26 26 if (trim($_POST['url_author']) == '') { … … 36 36 $posts_only = (empty($_POST['posts_only']))?false:true; 37 37 $alpha_order = (empty($_POST['alpha_order']))?false:true; 38 38 39 39 $core->blog->settings->put('authormode_active',$active,'boolean'); 40 40 $core->blog->settings->put('authormode_url_author',$url_author,'string'); … … 43 43 $core->blog->settings->put('authormode_default_alpha_order',$alpha_order,'boolean'); 44 44 $core->blog->triggerBlog(); 45 45 46 46 $msg = __('Configuration successfully updated.'); 47 47 }
Note: See TracChangeset
for help on using the changeset viewer.