NAVIGATION
This shows you the differences between two versions of the page.
english:phpwcms_replacer_rts:frontend_render:xbrowse-up [2010/03/15 07:04] Knut Heermann (flip-flop) |
english:phpwcms_replacer_rts:frontend_render:xbrowse-up [2018/06/03 18:09] (current) |
||
---|---|---|---|
Line 5: | Line 5: | ||
Different Browse UP for category/article-view in simple or listing article mode. -> [[english/phpwcms-system/article#display_modes|Display modes]]\\ | Different Browse UP for category/article-view in simple or listing article mode. -> [[english/phpwcms-system/article#display_modes|Display modes]]\\ | ||
- | - Browse up to the category //(article listing)// if the user is in a article detail view //(article listing mode set)//. \\ | + | - Browse up to the category //(article listing)// if the user is in article detail view //(article listing mode set)//. \\ |
- | - Browse up to the parent category if the user is in a article detail view //(simple article mode)// or category view. | + | - Browse up to the parent category if the user is in article detail view //(simple article mode)// or category view. |
This tag can alternatively be used for the built-in [[http://www.phpwcms-docu.de/navigation_tags.phtml|{BROWSE:UP:LinkText}]]. | This tag can alternatively be used for the built-in [[http://www.phpwcms-docu.de/navigation_tags.phtml|{BROWSE:UP:LinkText}]]. | ||
+ | |||
+ | <note important> | ||
+ | Please do not use this tag parallel with [[english/phpwcms_replacer_rts/frontend_render/xbrowse-next-prev-up]] //(There it is integrated).// | ||
+ | </note> | ||
---- | ---- | ||
\\ | \\ | ||
- | **rt_xbrowse_up** V1.0 14.03.2010 | + | **rt_xbrowse_up** V1.0/V1.1 14.03.2010 |
Docu: -- \\ | Docu: -- \\ | ||
Line 21: | Line 25: | ||
**CMS Version:** >= 1.3 \\ | **CMS Version:** >= 1.3 \\ | ||
**Version:** V1.0 \\ | **Version:** V1.0 \\ | ||
+ | **Version:** V1.1 recommended :!: \\ | ||
Line 38: | Line 43: | ||
\\ | \\ | ||
- | ==== Code: ==== | ||
+ | ==== Code V1.1: ==== | ||
+ | |||
+ | **V1.1 recommended :!:: \\ | ||
+ | ** Faster processing without function call and $GLOBALS, "LinkText" must be available %%''{XBROWSE:UP:LinkText}''%%. | ||
<code php |h rt_xbrowse_up |h > | <code php |h rt_xbrowse_up |h > | ||
Line 47: | Line 55: | ||
* Different Browse UP for category/article-view in | * Different Browse UP for category/article-view in | ||
* simple or listing article mode | * simple or listing article mode | ||
- | * - Browse up to the category (article listing) if the user is in a | + | * - Browse up to the category (article listing) if the user is in |
* article detail view (article listing mode set) | * article detail view (article listing mode set) | ||
- | * - Browse up to the parent category if the user is in a | + | * - Browse up to the parent category if the user is in |
+ | * article detail view (simple article mode) or category view | ||
+ | * | ||
+ | * V1.1: 14.03.2010 K.Heerrmann http://planmatrix.de | ||
+ | * TAG: {XBROWSE:UP:LinkText} | ||
+ | * | ||
+ | * Filename: rt_xbrowse_up.php | ||
+ | * Folder: /template/inc_script/frontend_render/ | ||
+ | * Switch: $phpwcms['allow_ext_render'] = 1; (/config/phpwcms/conf.inc.php) | ||
+ | * | ||
+ | * Forum: http://forum.phpwcms.org/viewtopic.php?f=16&t=19936 | ||
+ | *******************************************************************/ | ||
+ | // ---------------------------------------------------------------- | ||
+ | // obligate check for phpwcms constants | ||
+ | if (!defined('PHPWCMS_ROOT')) { | ||
+ | die("You Cannot Access This Script Directly, Have a Nice Day."); } | ||
+ | // ---------------------------------------------------------------- | ||
+ | |||
+ | |||
+ | // Different Browse UP | ||
+ | // ================================================================ | ||
+ | |||
+ | // Tag available // Tag im Content gesetzt? Z.B. {XBROWSE:UP:^^^^} | ||
+ | |||
+ | if(strpos($content["all"],'{XBROWSE:') !== false) { | ||
+ | |||
+ | // In detail view if article listing mode is set | ||
+ | // In der Detailansicht wenn Artikellisten-Modus aktiv | ||
+ | if ( empty($aktion['3']) ) { | ||
+ | |||
+ | // Jump to the category // gehe zur Kategorie | ||
+ | $link = $content["struct"][$content["cat_id"]]["acat_alias"]; | ||
+ | $link = '<a href="index.php?'.$link.'">$1</a>'; | ||
+ | |||
+ | // Only if not home cat // Nur wenn nicht Home Kategorie | ||
+ | // if ($content['cat_id'] == 0 ) $link = ''; | ||
+ | |||
+ | $content["all"] = preg_replace('/\{XBROWSE:UP:(.+?)\}/', $link, $content["all"]); | ||
+ | |||
+ | |||
+ | // In category view if simple article- or listing mode set | ||
+ | // In der Kategorie bei einfachem & Artikellisten-Modus | ||
+ | } else { | ||
+ | |||
+ | // Only if not home cat // Nur wenn nicht Home Kategorie | ||
+ | // if ($content['cat_id'] == 0 ) $content["all"] = preg_replace('/\{XBROWSE:UP:(.+?)\}/','',$content["all"]); | ||
+ | |||
+ | $content["all"] = preg_replace('/\{XBROWSE:UP:(.+?)\}/e','get_index_link_up("$1");',$content["all"]); | ||
+ | |||
+ | } | ||
+ | } | ||
+ | |||
+ | ?> | ||
+ | </code> | ||
+ | |||
+ | Optionally exclude the Home category, see 2x **''%%if ($content['cat_id'] == 0 ) ....;%%''** | ||
+ | \\ | ||
+ | |||
+ | |||
+ | \\ | ||
+ | |||
+ | ==== Code V1.0: ==== | ||
+ | |||
+ | |||
+ | <code php |h rt_xbrowse_up |h > | ||
+ | <?php | ||
+ | /** | ||
+ | ******************************************************************* | ||
+ | * Different Browse UP for category/article-view in | ||
+ | * simple or listing article mode | ||
+ | * - Browse up to the category (article listing) if the user is in | ||
+ | * article detail view (article listing mode set) | ||
+ | * - Browse up to the parent category if the user is in | ||
* article detail view (simple article mode) or category view | * article detail view (simple article mode) or category view | ||
* | * | ||
Line 77: | Line 157: | ||
function x_get_index_link_up($linktext) { | function x_get_index_link_up($linktext) { | ||
- | if (empty($linktext)) $linktext = '^UP^'; | + | if (empty($linktext['1'])) $linktext['1'] = '^UP^'; |
// In detail view if article listing mode is set | // In detail view if article listing mode is set | ||
Line 87: | Line 167: | ||
$link = '<a href="index.php?'.$link.'">'.$linktext['1'].'</a>'; | $link = '<a href="index.php?'.$link.'">'.$linktext['1'].'</a>'; | ||
- | // In category view if normal article- or listing mode set | + | // In category view if simple article- or listing mode set |
- | // In der Kategorie bei infachem & Artikellisten-Modus | + | // In der Kategorie bei einfachem & Artikellisten-Modus |
} else { | } else { | ||
Line 112: | Line 192: | ||
Optionally exclude the Home category, see **return ....;** | Optionally exclude the Home category, see **return ....;** | ||
\\ | \\ | ||
- |