Antwort
 
LinkBack Themen-Optionen Thema bewerten Ansicht
  #1  
Alt 16.08.07, 19:31
Forum Zuschauer
 
Registriert seit: 16.08.07
Beiträge: 6

tt_news und alphabetischer Pagebrowser


Hallo Allerseits,
gibt es ohne großen Aufwand Möglichkeiten die tt_news Datenbank im Frontend über einen alphabetischen Pagebrowser (A-Z) abzufragen?

Und wenn nicht - bevor ich lange suchen muss - wo setze ich an, dass zu realisieren? Hat da wer schon Erfahrungen mit gemacht?

Grüsse,
Matthias
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #2  
Alt 22.08.07, 13:27
Benutzerbild von MistaD
TYPO3 Forum Team
Moderator
 
Registriert seit: 25.01.06
Beiträge: 1.455

Hallo,


du meinst eine Art Glossar? Eine Extension die mir dazu einfällt, weil selbst im Einsatz ist sg_glossary. Vielleicht kannst du dir da ja etwas abschauen etc....




__________________
Gruss
MD
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #3  
Alt 23.08.07, 11:05
Forum Zuschauer
 
Registriert seit: 16.08.07
Beiträge: 6

Hi,
ich hatte einen Ansatz, habe mir aber dadurch die bisherigen tt_news Einträge ganz schön durcheinandergebracht.

PHP-Code:
<?php require_once(PATH_tslib."class.tslib_pibase.php");

class 
tx_lexicalsearch_pi1 extends tslib_pibase {
    var 
$prefixId "tx_lexicalsearch_pi1";        // Same as class name
    
var $scriptRelPath "pi1/class.tx_lexicalsearch_pi1.php";    // Path to this script relative to the extension dir.
    
var $extKey "lexical_search";    // The extension key.
    
    /**
     * [Put your description here]
     */
    
function main($content,$conf)    {
        
$GLOBALS["TSFE"]->set_no_cache();
        
$this->conf=$conf;
        
$this->pi_setPiVarDefaults();
        
$this->pi_loadLL();

        
$this->local_cObj =t3lib_div::makeInstance("tslib_cObj");        // Local cObj.
        
$this->tt_news_uid intval(t3lib_div::_GP("tt_news"));
        
$this->lettre t3lib_div::GPvar("lettre");
        
$this->mot t3lib_div::GPvar("mot");

        
$alphabet = array("#"=>0"A"=>0"B"=>0"C"=>0"D"=>0"E"=>0"F"=>0"G"=>0"H"=>0"I"=>0"J"=>0"K"=>0"L"=>0"M"=>0"N"=>0"O"=>0"P"=>0"Q"=>0"R"=>0"S"=>0"T"=>0"U"=>0"V"=>0"W"=>0"X"=>0"Y"=>0"Z"=>0);

        
$select "select uid,title from tt_news where title!='' ".$this->local_cObj->enableFields("tt_news");
        
$resultat mysql(TYPO3_db,$select);

        
/*
         * Selection of link letter and update of field title of the table pages to put in good format
         */
        
while ($row=mysql_fetch_assoc($resultat)) {
            
$mise_a_jour="";
            
$liste=explode(";",trim($row["title"]));
            while (list (
$key$val) = each ($liste)) {
                
$lettre=substr(trim($val),0,1);
                
$alphabet[strtoupper($lettre)]=1;
                
$mise_a_jour.=strtoupper(substr(trim($val),0,1)).strtolower(substr(trim($val),1,strlen($val))).";";
            }

            
$requete_maj="update tt_news set title='".substr($mise_a_jour,0,strlen($mise_a_jour)-1)."' where uid=".$row["uid"];
            
mysql(TYPO3_db,$requete_maj);
        }
        
        
/*
         * Display of the alphabet on top page
         */
        
while (list ($key$val) = each ($alphabet)) {
            if (
$val==1) {
                
$content.="<a href=index.php?id=".$this->id_page."&lettre=".$key.">".$this->applyWrap($key$this->conf["alphabetWrapLink"])."</a>";
            }
            elseif (
$this->conf["displayAlphabet"]) {
                
$content.=$this->applyWrap($key,$this->conf["alphabetWrap"]);
            }
        }

        
$content=$this->applyWrap($content,$this->conf["globalAlphabetWrap"]);

        
/*
         * Treatment after the selection of a letter
         */
        
if ($this->lettre) {
            
$content.="<br><br>";
            
            
// Display of the letter on head of list
            
$content.=$this->applyWrap($this->lettre$this->conf["headLetterWrap"])."<br><p>";

            
$compteur=0;
            
// Select of list of key word
            
$select "select title from tt_news where title!='' ".$this->local_cObj->enableFields("tt_news");
            
$resultat mysql(TYPO3_db,$select);

            
// Search of word with the good first letter
            
while ($row=mysql_fetch_assoc($resultat)) {
                
$liste=explode(";",trim($row["title"]));
                while (list (
$key$val) = each ($liste)) {
                    
$lettre=substr($val,0,1);
                    if (
$lettre==$this->lettre) {
                        
$find=false;
                        for (
$i=0;$i<$compteur;$i++) {
                            if (
$mots[$i]==$val)
                                
$find=true;
                        }
                        if (!(
$find)) {
                            
$mots[$compteur]=$val;
                            
$compteur++;
                        }
                    }
                }
            }

            
// Sort of the table with all words with good letter
            
sort($mots);
            
reset($mots);
            
            
/*
             * Display of words, if one link, the link is on word, if several link the link is on the new display list
             */
            
while (list ($key$val) = each ($mots)) {
                
$select "select uid from tt_news where title like '%".$val."%' ".$this->local_cObj->enableFields("tt_news");
                
$resultat mysql(TYPO3_db,$select);

                if (
mysql_num_rows($resultat) > 1) {
                    
$content.="<a href=index.php?id=".$this->id_page."&lettre=".$this->lettre."&mot=".$val.">".$this->applyWrap($val,$this->conf["wordWrap"])."</a><br>";
                    if (
$this->mot) {
                        
$select_liste "select uid, title from tt_news where title like '%".$this->mot.";%' ".$this->local_cObj->enableFields("tt_news");
                        
$resultat_liste mysql(TYPO3_db,$select_liste);
                        while (
$row_liste=mysql_fetch_assoc($resultat_liste)) {
                            
$content.="<a href=index.php?id=".$row_liste["uid"].">".$this->applyWrap(str_replace (";"" "$row_liste["title"]), $this->conf["wordListWrap"])."</a><br>";
                        }
                    }
                }
                else {
                    
$row=mysql_fetch_assoc($resultat);
                    
$page=$row["uid"];
                    
$content.="<a href=index.php?id=".$tt_news.">".$this->applyWrap($val$this->conf["wordWrap"])."</a><br>";
                }
            }

            
$content.="</p>";
        }
            
        return 
$this->pi_wrapInBaseClass($content);
    }

    
/*
     * Apply wrap on a text
     */
    
function applyWrap($text$wrap) {
        list(
$avant,$apres)=explode("|",$wrap);
        
$result=$avant.$text.$apres;
        return 
$result;
    }
}

if (
defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/lexical_search/pi1/class.tx_lexicalsearch_pi1.php"])    {
    include_once(
$TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/lexical_search/pi1/class.tx_lexicalsearch_pi1.php"]);
}

?>
...alles nicht so einfach...

Danke Euch im Voraus, liebe Grüsse,
Matthias
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht Thema bewerten
Thema bewerten:

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
tt_news LIST Pagebrowser patricia TYPO3 4.x Fragen und Probleme 0 24.07.07 10:58
tt_news pagebrowser sprache ilinca News (tt_news, mininews und Co) 1 15.09.06 08:30
pageBrowser Formatierung typ03 News (tt_news, mininews und Co) 7 16.05.06 20:59
floating PageBrowser Axel G. News (tt_news, mininews und Co) 0 10.05.06 13:27
Pagebrowser mit css verstecken tom HTML & CSS 1 02.12.05 20:46


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:05 Uhr.


Powered by vBulletin® Version 3.7.3 (Deutsch)
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0