Abfrage PHP in MySQL?

Byter

Mitglied
Ich habe eine Frage, weil ich nicht weiter komme und hoffe hier auf Hilfe?

Die Datenbank wird mit PHP abgefragt und anschließend mit info.tpl ausgegeben. Ich möchte nun die Variable "COMMNR" noch einmal auslesen und anhand der ausgegebenen Zahl festlegen, ob es sich um einen "Grünschnabel" "Fortgeschrittenen" oder "Forumsprofi" usw. handelt.


PHP:
function giveinfo($name)
  {
    global $main, $conf;
    $data = $this->giveuser($name);
    $group = $main->givegruppe($data['gruppe']);
    if(!$data && eregi($conf->user_gastname,$name)) $main->errormsg(_usgastno);
    else if(!$data) $main->errormsg(_usnoexist);
    else if($data['locked'] || $group['locked']) $main->errormsg(_uslocked);
    else if(!$data['auth'] || $data['fkey']) $main->errormsg(_usnotactive);
    else
    {
      $online = ($data['online']+$conf->user_onlinetime > $main->now) ? _usonline : _usoffline;
      $email = (empty($data['email'])) ? _usempty : tplprint(_usemail, array("EMAIL" => $data['email']));
      $homepage = (empty($data['homepage'])) ? _usempty : tplprint(_ushp, array("URL" => $data['homepage']));
      $icq = $data['uin'] ? tplprint(_usicq, array("ICQ" => $data['uin'])) : _usempty;
      $gbopen = $data['gblock'] ? _usgblo : _usgbop;

      $main->initsubmit();
      $tpl = tplload("user/info.tpl");
      $inhalt = tplprint($tpl, array(
      "NAME" => $data['name'],
      "COMMNR" => $data['comnum'],
      "INFO" => replacement(smilies(bbcode($data['info'])))));
      if(func_num_args() == 2 && func_get_arg(1))
      {
        $tpl = tplload("user/noshow.tpl");
        echo tplprint($tpl, array("NAME" => $name, "INHALT" => $inhalt, "PATH" => $conf->cfg_path));
        exit;
      }
      else $main->finalize($inhalt);
    }
  }


dann erfolgt die Ausgabe in info.tpl

PHP:
<tr bgcolor="#FFFFFF">
    <td width="26%" bgcolor="#FFFFFF"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#0099FF">Kommentare</font></b></td>
    <td width="74%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">{COMMNR}</font></td>
 </tr>

Wie bekomme ich das nun hin? Ich hoffe ich habe mich verständlich ausgedrückt?

cu Byter
 
Zurück