Differences

This shows you the differences between two versions of the page.

deutsch:ersetzer_rts:frontend_render:link-article-alias-id [2011/11/28 17:09]
Knut Heermann (flip-flop)
deutsch:ersetzer_rts:frontend_render:link-article-alias-id [2018/06/03 18:09] (current)
Line 3: Line 3:
====== Quick Artikellink mit ALIAS/ID ====== ====== Quick Artikellink mit ALIAS/ID ======
-Ein einfacher TAG der einen Link aufgrund der/s Artikel-ID/Alias erzeugt, welcher automatisch den Titel des Artikels als Linktext verwendet. \\+Ein einfacher TAG der einen Link aufgrund der/s Artikel-ID/Alias erzeugt, welcher automatisch den Titel des Artikels als Linktext verwendet.  
##**[QIDA|qIDA** Artikel-Alias oder Artikel-ID**]**## \\ ##**[QIDA|qIDA** Artikel-Alias oder Artikel-ID**]**## \\
Line 47: Line 48:
* frontend_render-Script: Link to article alias/id * frontend_render-Script: Link to article alias/id
* A single tag that makes a link, automatically grabs the title of the destination article * A single tag that makes a link, automatically grabs the title of the destination article
-* and inserts that as the link text +* and insert the title as link text 
-* TAGs: [QIDA|[qIDA article alias/article id]+* TAGs: [QIDA|[qIDA article alias|article id]
********************************************************************************************* *********************************************************************************************
*/ */
Line 67: Line 68:
if ( isset($match['1']) AND !empty($match['1']) ) { // if match found, replace if ( isset($match['1']) AND !empty($match['1']) ) { // if match found, replace
 + // Separate IDs and articles TAGs
$id_i = ''; $id_i = '';
$id_a = ''; $id_a = '';
Line 73: Line 75:
// ID or alias input??  // ID oder alias Eingabe???? // ID or alias input??  // ID oder alias Eingabe????
if ((int)$value == $value AND (int)$value != 0) if ((int)$value == $value AND (int)$value != 0)
- $id_i .= $value.',';+ $id_i .= trim($value).',';
else else
- $id_a .= "'".$value."',";+ $id_a .= "'".strtolower(trim($value))."',";
} }
-  + 
- $count = substr_count($id_i, ','); // Count the entries for a better db performance (LIMIT) + // Count all possible matches for a better db performance (LIMIT) 
- $count = $count + substr_count($id_a, ","); // Count the entries for a better db performance (LIMIT)+ $count = substr_count($id_i, ','); 
 + $count = $count + substr_count($id_a, ",");
$id_i = substr($id_i, 0, -1);  // Kill the last sign "," $id_i = substr($id_i, 0, -1);  // Kill the last sign ","
Line 111: Line 114:
$content["all"] = str_replace('[qIDA '.$value['article_id'].']',$link, $content["all"] ); $content["all"] = str_replace('[qIDA '.$value['article_id'].']',$link, $content["all"] );
// Output alias link // Output alias link
- $content["all"] = str_replace('[QIDA '.$value['article_alias'].']',$link, $content["all"] ); + $content["all"] = preg_replace('/\[QIDA '.$value['article_alias'].'\]/im',$link, $content["all"] );
- $content["all"] = str_replace('[qIDA '.$value['article_alias'].']',$link, $content["all"] );+
} }
else { else {
Line 125: Line 127:
\\ \\
-  * In "$hidden_article" können Artikel-IDs eingetragen werden, die von der Selektion ausgenommen sind. //('23,56,74,12,...') Hochkommata am Anfang und Ende verwenden!//+  * In "$hidden_article" können Artikel-IDs eingetragen werden, die von der Selektion ausgenommen sind. //%%('23,56,74,12,...')%% Hochkommata am Anfang und Ende verwenden!//
 +\\
deutsch/ersetzer_rts/frontend_render/link-article-alias-id.1322496578.txt.gz · Last modified: 2018/06/03 18:07 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0