
Public Member Functions | |
| clearCache () | |
| getContentMenuInfo () | |
| nameForURL ($string) | |
| translateContentTask ($task) | |
| untranslateContentTask ($tr_task) | |
| sefRetrieval () | |
| invoke_plugin ($i, $method, $parm1, $parm2=0) | |
| default_revert ($specialname) | |
| getHead ($title, $metatags, $customtags) | |
| makeMeta ($name, $value) | |
| sefComponentName ($cname) | |
| sefRelToAbs ($string, $specialamp=true) | |
Static Public Member Functions | |
| static | getInstance () |
Public Attributes | |
| $content_data = null | |
| $content_items = array() | |
| $content_sections = array() | |
| $content_categories = array() | |
Static Protected Attributes | |
| static | $instance = __CLASS__ |
Private Member Functions | |
| __construct () | |
| analyseStandardURI ($uri) | |
| redirect301 ($to) | |
| retrieveURI ($sef) | |
| parse ($string, &$parms) | |
| outSubstitution ($inuri, $outuri) | |
| componentDetails (&$params, $task) | |
Private Attributes | |
| $live_site = '' | |
| $home_page = false | |
| $mainmenu = array() | |
| $config = null | |
| $sef_name_string = '' | |
| $sef_translate_string = '' | |
| $content_tasks | |
| $content_menus = array() | |
| $metadata = null | |
| $SEF_SPACE | |
| $cache = null | |
| $cached = array() | |
| $cacheWritten = array() | |
| $cacheObject = null | |
| $database = null | |
Definition at line 154 of file aliroSEF.php.
| aliroSEF::__construct | ( | ) | [private] |
Definition at line 225 of file aliroSEF.php.
References aliroFriendlyBase::getCfg(), aliroMenuHandler::getInstance(), and aliroDatabase::getInstance().
00225 { 00226 $this->database = aliroDatabase::getInstance(); 00227 $this->live_site = $this->getCfg('live_site'); 00228 00229 /******************************************************************************* 00230 ** The following are parameters for the ReMOSef Search Engine 00231 ** Optimisation component. $this->SEF_SPACE should be set to the 00232 ** character that is to replace blanks in names that form the URL. 00233 ** You can privatey this, although the only sensible choices seem to be 00234 ** underscore or hyphen (_ or -). 00235 ** 00236 ** The arrays $this->config->custom_code and $this->config->custom_name must be kept exactly 00237 ** in step with each other. $this->custom_code is a list of the components 00238 ** that are to be handled by ReMOSef. 00239 ** 00240 ** The array $this->config->custom_name is the alternative name that will be used 00241 ** in the optimised URL to identify the component and can be whatever 00242 ** you please so long as it is unique and legal for a URL. Apart from 00243 ** using the custom name for the component, ReMOSef will do no further 00244 ** translation of the URL than is done by the standard Mambo SEF - UNLESS 00245 ** there is a sef_ext.php file installed for that component. The 00246 ** exception to this is ReMOSitory - the optimisation code for Remository 00247 ** is integrated in ReMOSef. For other components, if a sef_ext.php is 00248 ** present, it will be invoked by ReMOSef. 00249 ** 00250 ** The array $remosef_content_task is capable of translating the tasks 00251 ** understood by the Mambo content component. Please DO NOT CHANGE what 00252 ** is to the left of the equals sign. When putting different values on 00253 ** the right hand side, remember that they must all be different, and must 00254 ** also be different from any of the custom names used for components. 00255 ** Without that, Remosef cannot figure out what a SEF URL means and will 00256 ** give unpredictable results. 00257 ** 00258 ** Note that the names in custom_name must not be allowed to clash with 00259 ** the names used as tasks by the content component, in their 00260 ** translated form - see below. 00261 *******************************************************************************/ 00262 // Use of underscore is NOT recommended, as search engines then do not see the words 00263 global $_SEF_SPACE; // divide words with hyphens 00264 $this->SEF_SPACE = $_SEF_SPACE = "-"; // divide words with hyphens 00265 /******************************************************************************* 00266 ** The following are the parameters for the optional content specific 00267 ** URL optimisation. They are not used within the standard SEF processing 00268 ** unless you add in a sef_ext.php that is integrated with the Mambo SEF. 00269 ** 00270 ** The following two lines define the translations that SEF will perform on 00271 ** names of sections and categories when translating them for inclusion in a URL. 00272 ** Each item in $this->config->sef_name_chars is translated into the corresponding 00273 ** element of $this->config->sef_translate_chars. 00274 ** 00275 ** NOTE it is important that space be the last translate character, since the 00276 ** characters are processed in the order in which they appear. Since earlier 00277 ** translates may create new spaces, it is vital that the space translation is 00278 ** done last. 00279 ** 00280 ** You can extend these arrays as you wish, although it is obviously important 00281 ** to make sure that the items of one match the items of the other exactly. 00282 *******************************************************************************/ 00283 $this->sef_name_string = '"\''; 00284 $this->sef_translate_string = '--'; 00285 00286 $this->cache =new aliroCache('aliroSEF'); 00287 $this->config = $this->cache->get('sefConfig'); 00288 if (!$this->config) { 00289 $helper = new aliroSEFHelper(); 00290 $this->config = $helper->getConfig($this->SEF_SPACE, $this->content_tasks); 00291 $this->cache->save($this->config); 00292 } 00293 00294 $this->mainmenu = aliroMenuHandler::getInstance()->getByParentOrder('mainmenu'); 00295 if ($this->mainmenu) foreach ($this->mainmenu as $menu) { 00296 $stage2 = parse_url($menu->link); 00297 if (isset($stage2['query'])) { 00298 parse_str($stage2['query'], $parms); 00299 if (isset($parms['option']) AND 'com_content' == $parms['option']) { 00300 if (isset($parms['task'])) $this->content_menus[$parms['task']][$menu->id] = $parms; 00301 } 00302 } 00303 } 00304 00305 $this->cached = $this->cache->get('sefDataURI'); 00306 if (!$this->cached) { 00307 $this->cached['SEF'] = $this->cached['Time'] = array(); 00308 $results = $this->database->doSQLget("SELECT * FROM #__remosef_uri ORDER BY refreshed DESC LIMIT {$this->config->buffer_size}"); 00309 foreach ($results as $result) { 00310 $uri = $result->uri; 00311 $this->cached['SEF'][$uri] = $result->sef; 00312 $this->cached['Time'][$uri] = $result->refreshed; 00313 } 00314 unset($results); 00315 $this->cache->save($this->cached); 00316 } 00317 }
| static aliroSEF::getInstance | ( | ) | [static] |
Definition at line 319 of file aliroSEF.php.
Referenced by aliroPathway::__construct(), aliroUserTemplateBase::__get(), aliroUserRequest::doControl(), aliroAbstractPageNav::fixLink(), aliroUserPageNav::getLimitBox(), aliroAbstractRequest::invokeComponent(), aliroMenuCreator::makeMenuLink(), aliroPage404::searchuri(), aliroFolderHandler::setFolderPathway(), and aliroAbstractRequest::showHead().
00319 { 00320 return is_object(self::$instance) ? self::$instance : (self::$instance = new self::$instance()); 00321 }
| aliroSEF::clearCache | ( | ) |
| aliroSEF::getContentMenuInfo | ( | ) |
| aliroSEF::nameForURL | ( | $ | string | ) |
Definition at line 331 of file aliroSEF.php.
00331 { 00332 $strips = explode ('|', $this->config->strip_chars); 00333 $string = str_replace($strips, '', (string) $string); 00334 $string = aliroUnaccent::getInstance()->unaccent($string); 00335 $string = str_replace($this->config->sef_name_chars, $this->config->sef_translate_chars, $string); 00336 $string = urlencode($string); 00337 return $string; 00338 }
| aliroSEF::translateContentTask | ( | $ | task | ) |
Definition at line 340 of file aliroSEF.php.
00340 { 00341 return isset($this->config->sef_content_task[$task]) ? $this->config->sef_content_task[$task] : $task; 00342 }
| aliroSEF::untranslateContentTask | ( | $ | tr_task | ) |
Definition at line 344 of file aliroSEF.php.
00344 { 00345 $task = array_search ($tr_task, $this->config->sef_content_task); 00346 if (!$task) $task = $tr_task; 00347 return in_array($task, $this->content_tasks) ? $task : null; 00348 }
| aliroSEF::analyseStandardURI | ( | $ | uri | ) | [private] |
Definition at line 350 of file aliroSEF.php.
References $_REQUEST.
Referenced by sefRetrieval().
00350 { 00351 $_SERVER['REQUEST_URI'] = $uri; 00352 // Should think about using cache for this 00353 if (isset($this->cached['metadata'][$uri])) $this->metadata = $this->cached['metadata'][$uri]; 00354 else { 00355 $this->database->setQuery("SELECT * FROM #__remosef_metadata WHERE uri = '$uri'"); 00356 $this->database->loadObject($this->metadata); 00357 if (is_null($this->metadata)) $this->metadata = new stdClass(); 00358 $this->cached['metadata'][$uri] = $this->metadata; 00359 $this->cache->save($this->cached, 'sefDataURI'); 00360 } 00361 $mainparts = explode('?', $uri); 00362 if (empty($mainparts[1])) return; 00363 $_SERVER['QUERY_STRING'] = $mainparts[1]; 00364 $vars = explode('&', $mainparts[1]); 00365 foreach ($vars as $var) { 00366 $parts = explode('=', $var); 00367 if (!empty($parts[1])) { 00368 $_REQUEST[$parts[0]] = $_GET[$parts[0]] = $parts[1]; 00369 } 00370 } 00371 }
| aliroSEF::redirect301 | ( | $ | to | ) | [private] |
Definition at line 373 of file aliroSEF.php.
Referenced by sefRetrieval().
00373 { 00374 header ('HTTP/1.1 301 Moved Permanently'); 00375 header ('Location:'.$to); 00376 exit; 00377 }
| aliroSEF::sefRetrieval | ( | ) |
Definition at line 379 of file aliroSEF.php.
References analyseStandardURI(), redirect301(), retrieveURI(), and sefRelToAbs().
00379 { 00380 $uri = $_SERVER['REQUEST_URI']; 00381 $sublength = strlen(dirname($_SERVER['PHP_SELF'])); 00382 if (1 < $sublength) $uri = substr($uri,$sublength); 00383 $uri = str_replace(array('!', '%21', '&'), array('','','&'), $uri); 00384 if (!$uri OR $uri == '/' or $uri == '/index.php') { 00385 $this->home_page = true; 00386 return 0; 00387 } 00388 if (preg_match('/(\b)GLOBALS|_REQUEST|_SERVER|_ENV|_COOKIE|_GET|_POST|_FILES|_SESSION(\b)/i', $uri) > 0) { 00389 die('Invalid Request'); 00390 } 00391 $regex = '#[<>\(\)@"\']+|/\?#'; 00392 if (preg_match($regex, $uri)) return 1; 00393 $saveuri = $uri; 00394 $uri = str_replace('//', '/', $uri); 00395 if ($this->config->underscore AND $this->SEF_SPACE == '-' AND strpos($uri,'_') !== false) $uri = str_replace('_', '-', $uri); 00396 $exactback = array_search($uri, $this->config->sef_substitutions_exact); 00397 if (false === $exactback AND '/' != substr($uri,-1)) { 00398 $exactback = array_search($uri.'/', $this->config->sef_substitutions_exact); 00399 if (false !== $exactback) $this->redirect301($this->live_site.$uri.'/'); 00400 } 00401 if (false !== $exactback) { 00402 $this->analyseStandardURI($exactback); 00403 return 0; 00404 } 00405 $uri = @preg_replace(array_keys($this->config->sef_substitutions_in), array_values($this->config->sef_substitutions_in), $uri); 00406 if ($indexloc = strpos($uri, 'index.php?')) { 00407 if ($_SERVER['REQUEST_METHOD'] == 'GET') { 00408 $sefagain = substr($this->sefRelToAbs(substr($uri,$indexloc), false),strlen($this->live_site)); 00409 if ($saveuri != $sefagain) $this->redirect301($sefagain); 00410 } 00411 return 0; 00412 } 00413 elseif (false !== strpos($uri,'index2.php') OR false !== strpos($uri,'index3.php')) return 0; 00414 $retrieved = $this->retrieveURI ($uri); 00415 if (!$retrieved AND '/' != substr($uri,-1)) { 00416 $retrieved = $this->retrieveURI($uri.'/'); 00417 if ($retrieved) $this->redirect301($this->live_site.$uri.'/'); 00418 } 00419 if (!$retrieved) { 00420 $helper = new aliroSEFHelper(); 00421 $retrieved = $helper->basicRetrieve($uri, $this->config, $this, $this->live_site); 00422 if ($retrieved) trigger_error('Had to invoke SEF basicRetrieve: '.$uri.' : '.$retrieved); 00423 } 00424 00425 if ($retrieved) { 00426 $retrieved = 'index.php?'.$retrieved; 00427 $sefagain = substr($this->sefRelToAbs($retrieved),strlen($this->live_site)); 00428 if ($saveuri != $sefagain AND $_SERVER['REQUEST_METHOD'] == 'GET') $this->redirect301($sefagain); 00429 $this->analyseStandardURI($retrieved); 00430 $returncode = 0; 00431 } 00432 else $returncode = 1; 00433 00434 return $returncode; 00435 }
| aliroSEF::retrieveURI | ( | $ | sef | ) | [private] |
Definition at line 437 of file aliroSEF.php.
References $sef.
Referenced by sefRetrieval().
00437 { 00438 $retrieved = array_search($sef, $this->cached['SEF']); 00439 if ($retrieved) return $retrieved; 00440 $coded_sef = $this->database->getEscaped($sef); 00441 $this->database->setQuery("SELECT uri FROM #__remosef_uri WHERE sef='$coded_sef'"); 00442 $this->database->loadObject($sefdata); 00443 if ($sefdata) return $sefdata->uri; 00444 else return false; 00445 }
| aliroSEF::invoke_plugin | ( | $ | i, | |
| $ | method, | |||
| $ | parm1, | |||
| $ | parm2 = 0 | |||
| ) |
Definition at line 448 of file aliroSEF.php.
Referenced by sefRelToAbs().
00448 { 00449 error_reporting(E_ALL); 00450 require_once($this->config->custom_PHP[$i]); 00451 $classname = 'sef_'.$this->config->custom_short[$i]; 00452 $compname = 'com_'.$this->config->custom_short[$i]; 00453 $maptags = isset($this->config->component_details[$compname]) ? $this->config->component_details[$compname] : array(); 00454 if (method_exists($classname, 'getInstance')) { 00455 $plugin = call_user_func(array($classname, 'getInstance')); 00456 if ('create' == $method) return $plugin->$method($parm1, $this->config->lower_case, $this->config->unique_id, $maptags); 00457 else return $plugin->revert($parm1, $parm2, $maptags); 00458 } 00459 else { 00460 $callplugin = array($classname, $method); 00461 if ('create' == $method) return call_user_func ($callplugin, $parm1, $this->config->lower_case, $this->config->unique_id, $maptags); 00462 else return call_user_func ($callplugin, $parm1, $parm2, $maptags); 00463 } 00464 }
| aliroSEF::default_revert | ( | $ | specialname | ) |
Definition at line 467 of file aliroSEF.php.
References $_REQUEST.
00467 { 00468 $request = explode($specialname.'/', $_SERVER['REQUEST_URI']); 00469 if (isset($request[1])) $parmset = explode("/", $request[1]); 00470 else $parmset = array(); 00471 $QUERY_STRING = ''; 00472 foreach($parmset as $values) { 00473 $parts = explode(",", $values); 00474 if (count($parts) > 1) { 00475 $_REQUEST[$parts[0]] = $_GET[$parts[0]] = $parts[1]; 00476 if ($parts[0] == 'option') $QUERY_STRING .= "option=$parts[1]"; 00477 else $QUERY_STRING .= "&$parts[0]=$parts[1]"; 00478 } 00479 } 00480 return $QUERY_STRING; 00481 }
| aliroSEF::parse | ( | $ | string, | |
| &$ | parms | |||
| ) | [private] |
Definition at line 483 of file aliroSEF.php.
Referenced by sefRelToAbs().
00483 { 00484 $parms = array(); 00485 $parts = explode('&', $string); 00486 foreach ($parts as $part) { 00487 $assigns = explode('=', $part); 00488 if (count($assigns) == 2) $parms[$assigns[0]] = $assigns[1]; 00489 } 00490 }
| aliroSEF::getHead | ( | $ | title, | |
| $ | metatags, | |||
| $ | customtags | |||
| ) |
Definition at line 492 of file aliroSEF.php.
References aliroFriendlyBase::getCfg(), and makeMeta().
00492 { 00493 $head = $found = array(); 00494 $block['title'] = 1; 00495 $sitename = $this->getCfg('sitename'); 00496 if ($this->home_page) $extratitle = $this->config->home_title; 00497 elseif (empty($this->metadata->htmltitle)) { 00498 if (strlen($title) > strlen($sitename)) $extratitle = substr($title, 0, -(strlen($sitename)+3)); 00499 else $extratitle = ''; 00500 } 00501 else $extratitle = htmlspecialchars($this->metadata->htmltitle, ENT_QUOTES, 'UTF-8'); 00502 if ($extratitle) { 00503 if (strlen($extratitle) + strlen($sitename) < 60) $extratitle .= ' '.$this->config->title_separator.' '.$sitename; 00504 } 00505 else $extratitle = $sitename; 00506 $head[] = '<title>' . $extratitle . '</title>'; 00507 00508 if (!empty($this->metadata->description)) { 00509 $head[] = $this->makeMeta('description', htmlspecialchars($this->metadata->description, ENT_QUOTES, 'UTF-8')); 00510 $block['description'] = 1; 00511 } 00512 if (!empty($this->metadata->keywords)) { 00513 $head[] = $this->makeMeta('keywords', htmlspecialchars($this->metadata->keywords, ENT_QUOTES, 'UTF-8')); 00514 $block['keywords'] = 1; 00515 } 00516 if (!empty($this->metadata->robots)) { 00517 $head[] = $this->makeMeta('robots', htmlspecialchars($this->metadata->robots, ENT_QUOTES, 'UTF-8')); 00518 $block['robots'] = 1; 00519 } 00520 00521 foreach ($metatags as $name=>$meta) { 00522 if (isset($block[$name]) OR empty($meta[0])) continue; 00523 $found[$name] = 1; 00524 if ($meta[1]) $head[] = $meta[1]; 00525 $head[] = $this->makeMeta ($name, $meta[0]); 00526 if ($meta[2]) $head[] = $meta[2]; 00527 } 00528 00529 if (empty($block['description']) AND empty($found['description'])) $head[] = $this->makeMeta('description', htmlspecialchars($this->getCfg('MetaDesc'), ENT_QUOTES, 'UTF-8')); 00530 if (empty($block['keywords']) AND empty($found['keywords'])) $head[] = $this->makeMeta('keywords', htmlspecialchars($this->getCfg('MetaKeys'), ENT_QUOTES, 'UTF-8')); 00531 if (empty($block['robots']) AND empty($found['robots'])) $head[] = $this->makeMeta('robots', $this->config->default_robots); 00532 00533 foreach ($customtags as $html) $head[] = $html; 00534 return implode( "\n", $head )."\n"; 00535 }
| aliroSEF::makeMeta | ( | $ | name, | |
| $ | value | |||
| ) |
Definition at line 537 of file aliroSEF.php.
References name.
Referenced by getHead().
00537 { 00538 return <<<META_DATA 00539 <meta name="$name" content="$value" /> 00540 META_DATA; 00541 00542 }
| aliroSEF::sefComponentName | ( | $ | cname | ) |
Definition at line 544 of file aliroSEF.php.
00544 { 00545 $i = array_search($cname,$this->config->custom_code); 00546 return ($i !== false AND $i !== null) ? $this->config->custom_name[$i] : $cname; 00547 }
| aliroSEF::sefRelToAbs | ( | $ | string, | |
| $ | specialamp = true | |||
| ) |
Definition at line 549 of file aliroSEF.php.
References componentDetails(), aliroFriendlyBase::getCfg(), invoke_plugin(), and parse().
Referenced by sefRetrieval().
00549 { 00550 if ($string == 'index.php') return $this->live_site.'/'; 00551 if (strtolower(substr($string,0,9)) != 'index.php' OR eregi('^(([^:/?#]+):)',$string)) return $string; 00552 $string = str_replace('&', '&', $string); 00553 $clean_string = preg_replace('/\&Itemid=[0-9]*/', '', $string); 00554 $homelink = $this->mainmenu[0]->link; 00555 if ($clean_string == $homelink) return $this->live_site.'/'; 00556 if (!($this->getCfg('sef')) OR !$this->config->enabled) return $this->live_site.'/'.($specialamp ? str_replace( '&', '&', $clean_string ) : $clean_string); 00557 $string = substr($clean_string,10); 00558 if (isset($this->config->sef_substitutions_exact['/'.$clean_string])) return $this->live_site.$this->config->sef_substitutions_exact['/'.$clean_string]; 00559 if (isset($this->cached['SEF'][$clean_string]) AND (time() - $this->config->cachedTime[$clean_string]) < $this->config->cache_time) return $this->live_site.$this->cached['SEF'][$clean_string]; 00560 $oktasks = true; 00561 $option = $task = ''; 00562 $this->parse($string, $params); 00563 foreach ($params as $key=>$value) { 00564 $lowkey = strtolower($key); 00565 $lowvalue = strtolower($value); 00566 $unset = true; 00567 switch ($lowkey) { 00568 case 'option': 00569 $option = $lowvalue; 00570 break; 00571 case 'task': 00572 $task = $value; 00573 if ($lowvalue == 'new' OR $lowvalue == 'edit') $oktasks = false; 00574 break; 00575 default: 00576 $check_params[$lowkey] = $key; 00577 $unset = false; 00578 } 00579 if ($unset) unset($params[$key]); 00580 } 00581 // Process content items 00582 if (($option == 'com_content' OR $option == 'content') AND $oktasks) { 00583 /* 00584 Content 00585 index.php?option=com_content&task=$task§ionid=$sectionid&id=$id&Itemid=$Itemid&limit=$limit&limitstart=$limitstart 00586 */ 00587 $content_sef = _ALIRO_CLASS_BASE.'/components/com_content/sef_ext.php'; 00588 if (file_exists($content_sef)) { 00589 require_once($content_sef); 00590 $result = sef_content::create($task, $params, $this->config->lower_case, $this->config->unique_id); 00591 return $this->live_site.$this->outSubstitution($string, $result); 00592 } 00593 $keys = array('sectionid', 'id', 'itemid', 'limit', 'limitstart', 'year', 'month', 'module', 'lang'); 00594 $result = '/content/'.$task.'/'; 00595 foreach ($keys as $key) { 00596 if (isset($check_params[$key])) { 00597 $pkey = $check_params[$key]; 00598 $result .= $params[$pkey].'/'; 00599 } 00600 } 00601 return $this->live_site.$this->outSubstitution($string, $result); 00602 } 00603 // Process customised components 00604 $i = array_search($option,$this->config->custom_code); 00605 if ($i !== false AND $i !== null) { 00606 if ($this->config->custom_PHP[$i] AND file_exists($this->config->custom_PHP[$i])) { 00607 $result = $this->invoke_plugin ($i, 'create', $clean_string); 00608 } 00609 else $result = $this->componentDetails($params,$task); 00610 $cname = $this->config->custom_name[$i]; 00611 $result = '/'.($this->config->lower_case ? strtolower($cname) : $cname).'/'.$result; 00612 return $this->live_site.$this->outSubstitution($string, $result); 00613 } 00614 // Process ordinary components 00615 if (strpos($option,'com_')===0 AND $option != 'com_registration' AND $oktasks) { 00616 $result = "/component/option,$option/".$this->componentDetails($params,$task); 00617 return $this->live_site.$this->outSubstitution($string, $result); 00618 } 00619 // Anything else is returned as received, except it is guaranteed that & will be & 00620 return $this->live_site.'/'.($specialamp ? str_replace( '&', '&', $clean_string ) : $clean_string); 00621 }
| aliroSEF::outSubstitution | ( | $ | inuri, | |
| $ | outuri | |||
| ) | [private] |
Definition at line 623 of file aliroSEF.php.
References $sef.
00623 { 00624 $now = time(); 00625 // if ($this->config->underscore AND $this->SEF_SPACE == '-' AND strpos($outuri,'_') !== false) $outuri = str_replace('_', '-', $outuri); 00626 $finishedurl = @preg_replace(array_keys($this->config->sef_substitutions_out), array_values($this->config->sef_substitutions_out), $outuri); 00627 if (isset($this->cached['SEF'][$inuri]) AND $finishedurl == $this->cached['SEF'][$inuri] AND ($now - $this->cached['Time'][$inuri] < (int) $this->config->cache_time)) return $finishedurl; 00628 $this->cached['SEF'][$inuri] = $finishedurl; 00629 $this->cached['Time'][$inuri] = $now; 00630 $this->cache->save($this->cached, 'sefDataURI'); 00631 $sef = $this->database->getEscaped($finishedurl); 00632 $uri = $this->database->getEscaped($inuri); 00633 $this->database->doSQL("UPDATE #__remosef_uri SET sef = '$sef', refreshed = $now, marker = 1 - marker WHERE uri = '$uri'"); 00634 if (0 == $this->database->getAffectedRows()) { 00635 $this->database->doSQL("INSERT INTO #__remosef_uri (uri, sef, refreshed) VALUES ('$uri', '$sef', $now)"); 00636 } 00637 if (50 == mt_rand(0,99)) { 00638 $weekago = $now - 7*24*60*60; 00639 $chkcode = 'option=com_remository&Itemid=65&func=download&id'; 00640 $this->database->doSQL("DELETE FROM #__remosef_uri WHERE uri LIKE '$chkcode%' AND refreshed < $weekago"); 00641 } 00642 return $finishedurl; 00643 }
| aliroSEF::componentDetails | ( | &$ | params, | |
| $ | task | |||
| ) | [private] |
Definition at line 645 of file aliroSEF.php.
Referenced by sefRelToAbs().
00645 { 00646 $string = ($task ? "task,$task/" : ''); 00647 foreach ($params as $key=>$param) { 00648 $param = urlencode($param); 00649 $string .= "$key,$param/"; 00650 } 00651 return $string; 00652 }
aliroSEF::$instance = __CLASS__ [static, protected] |
Definition at line 155 of file aliroSEF.php.
aliroSEF::$live_site = '' [private] |
Definition at line 158 of file aliroSEF.php.
aliroSEF::$home_page = false [private] |
Definition at line 159 of file aliroSEF.php.
aliroSEF::$mainmenu = array() [private] |
Definition at line 160 of file aliroSEF.php.
aliroSEF::$config = null [private] |
Definition at line 161 of file aliroSEF.php.
aliroSEF::$sef_name_string = '' [private] |
Definition at line 188 of file aliroSEF.php.
aliroSEF::$sef_translate_string = '' [private] |
Definition at line 189 of file aliroSEF.php.
aliroSEF::$content_tasks [private] |
Initial value:
array (
'findkey',
'view',
'section',
'category',
'blogsection',
'blogcategorymulti',
'blogcategory',
'archivesection',
'archivecategory',
'save',
'cancel',
'emailform',
'emailsend',
'vote',
'showblogsection'
)
Definition at line 190 of file aliroSEF.php.
aliroSEF::$content_menus = array() [private] |
Definition at line 207 of file aliroSEF.php.
aliroSEF::$metadata = null [private] |
Definition at line 208 of file aliroSEF.php.
| aliroSEF::$content_data = null |
Definition at line 211 of file aliroSEF.php.
| aliroSEF::$content_items = array() |
Definition at line 212 of file aliroSEF.php.
| aliroSEF::$content_sections = array() |
Definition at line 213 of file aliroSEF.php.
| aliroSEF::$content_categories = array() |
Definition at line 214 of file aliroSEF.php.
aliroSEF::$SEF_SPACE [private] |
Definition at line 217 of file aliroSEF.php.
aliroSEF::$cache = null [private] |
Definition at line 218 of file aliroSEF.php.
aliroSEF::$cached = array() [private] |
Definition at line 219 of file aliroSEF.php.
aliroSEF::$cacheWritten = array() [private] |
Definition at line 220 of file aliroSEF.php.
aliroSEF::$cacheObject = null [private] |
Definition at line 221 of file aliroSEF.php.
aliroSEF::$database = null [private] |
Definition at line 223 of file aliroSEF.php.
1.5.5