---
title: "player profile basic"
url: "https://www.typo3.net/d/11878-player-profile-basic"
source: "typo3.net"
tags: ["Extensions","Entwicklung","Frage"]
created: "2004-05-27"
last_reply: "2004-06-03"
replies: 11
solved: false
page: 1
pages: 1
lang: "de"
---

# player profile basic

Extensions › Entwicklung · 11 Antworten · gestartet 2004-05-27

## Eröffnungsbeitrag

**ffr_dev** · 2004-05-27 · [Beitrag #1](https://www.typo3.net/d/11878-player-profile-basic/1)

hi,
ich bin grad an der doku "creating a basic extension"
ext_key: player_profile_basic

die doku hab ich bis und mit seite 8 "extending the extension with last name field"

eigentlich müsste ich doch im frontend die felder sehen??
aber es kommt einfach ein leerer content.

hat jemand erfahrung mit dieser doku, oder hat sonst jemand eine ahnung was ich falsch mache??

## Antworten

### [#2](https://www.typo3.net/d/11878-player-profile-basic/2) · TW · 2004-05-27

hi
wie sieht denn dein php code bis jetzt aus????
kenn die doku zwar nicht, aber php kenn ich ;)

cu
thorsten

### [#3](https://www.typo3.net/d/11878-player-profile-basic/3) · ffr_dev · 2004-05-27

File: pi1/class.tx_playerprofile_pi1.php

```php
<?php
require_once(PATH_tslib."class.tslib_pibase.php");
class tx_playerprofile_pi1 extends tslib_pibase {
  var $prefixId = "tx_playerprofile_pi1"; // Same as class name – no _ allowed
  var $scriptRelPath = "pi1/class.tx_playerprofile_pi1.php"; // Path to this script relative to the extension dir.
  var $extKey = "player_profile"; // The extension key.
  var $conf;
  /**
  * [Output for image, first name and last name]
  */
  function main($content,$conf) {
    $this->conf = $conf;
    $content="";
    $rows=$this->getItems();
    while(list($c,$row)=each($rows)) {
      $this->conf["image."]["file"] = "uploads/tx_playerprofile/".($row["image"]); //The image field name
      $theImgCode=$this->cObj->IMAGE($this->conf["image."]);
      $content.=$theImgCode."<br>";
      $content.=($row["first_name"])."&nbsp;"; //This outputs the first name
      $content.=($row["last_name"])."<br><br>"; //This is the additional field
      //next, the output displayed in a table
      $content.="<table border=1><tr><td>".($row["first_name"])."</td></tr>";
      $content.="<tr><td>".($row["last_name"])."</td></tr></table>";
    }
    #t3lib_div::debug($conf); 
    #t3lib_div::debug($this->getItems());
    return $content;
  }

  /**
  * function.
  */
  function getItems() {
    // pid_list is the pid/list of pids from where to fetch the guest items.
    $config["pid_list"] = trim($this->cObj->stdWrap($this->conf["pid_list"],$this->conf ["pid_list."]));
    $config["pid_list"] = $config["pid_list"] ? implode(t3lib_div::intExplode(",",$config ["pid_list"]),",") : $GLOBALS["TSFE"]->id;
    list($pid) = explode(",",$config["pid_list"]);
    $query = "SELECT * FROM tx_playerprofile_list WHERE pid IN (".$pid.") ORDER BY sorting";
    $res = mysql(TYPO3_db,$query);
    $out=array();
    while($row = mysql_fetch_assoc($res)) {
      $out[]=$row;
    }
    return $out;
  }
}

if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/player_profile/pi1/class.tx_playerprofile_pi1.php"]) {
  include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/player_profile/pi1/class.tx_playerprofile_pi1.php"]);
}
?>
```

folgendes wir als content generiert..

```html
	<!--  CONTENT ELEMENT, uid:71/list [begin] -->
		<a name="71"></a>
		<!--  Plugin inserted: [begin] -->
			
		<!--  Plugin inserted: [end] -->
			
	<!--  CONTENT ELEMENT, uid:71/list [end] -->
```

### [#4](https://www.typo3.net/d/11878-player-profile-basic/4) · TW · 2004-05-27

hi

```php
function getItems() { 
    // pid_list is the pid/list of pids from where to fetch the guest items. 
    $config["pid_list"] = trim($this->cObj->stdWrap($this->conf["pid_list"],$this->conf ["pid_list."])); 
    $config["pid_list"] = $config["pid_list"] ? implode(t3lib_div::intExplode(",",$config ["pid_list"]),",") : $GLOBALS["TSFE"]->id; 
    list($pid) = explode(",",$config["pid_list"]); 
    $query = "SELECT * FROM tx_playerprofile_list WHERE pid IN (".$pid.") ORDER BY sorting"; 
    $res = mysql(TYPO3_db,$query); 
    $out=array(); 
    while($row = mysql_fetch_assoc($res)) { 
      $out[]=$row; 
    } 
    return $out; 
  } 
}
```

mach die zeile mal weg

```php
$query = "SELECT * FROM tx_playerprofile_list WHERE pid IN (".$pid.") ORDER BY sorting";
```

und mach dafür folgendes

```php
$query = "SELECT * FROM tx_spielerprofile_list ORDER BY sorting";
```

cu
thorsten

### [#5](https://www.typo3.net/d/11878-player-profile-basic/5) · ffr_dev · 2004-05-27

ich hab grad gesehen das die tabelle
tx_playerprofile_list gar nich existiert :o

dh. es ist was anderes schief gegangen,
wenn ich die tabelle richtig erstellt hab und es dann immer noch nicht funzt, dann probier ich mal dein tip aus.

ich meld mich dann wieder..

danke

### [#6](https://www.typo3.net/d/11878-player-profile-basic/6) · ffr_dev · 2004-05-27

ich hab übersehen, das typo3 tx_<extension name> hat,
und man nur den rest (in diesem fall "list") hinzufügen muss 8-)

anstatt:
**tx_playerprofile_list**
hiess dann die tabelle
**tx_playerprofile_tx_playerprofile_list**

danke

### [#7](https://www.typo3.net/d/11878-player-profile-basic/7) · TW · 2004-05-27

bitte

### [#8](https://www.typo3.net/d/11878-player-profile-basic/8) · ffr_dev · 2004-06-02

da bin ich nochmals..
leider hat das ganze nicht funktioniert, da hab ich mich ein bisschen frustriert einem anderen thema gewidmet.

jetzt geh ich das ganze hald nochmals an.

ich habs so probiert, aber auch das nützt nichts.

```php
$query = "SELECT * FROM tx_playerprofile_list ORDER BY sorting";
```

bin also für erneute hilfe sehr dankbar..

### [#9](https://www.typo3.net/d/11878-player-profile-basic/9) · zero · 2004-06-03

Benutzt du Typo 3.5 oder Typo 3.6?
Falls du 3.6 benutzt, ich habe das selbe Problem.

Mit Typo 3.5 hat alles wunderbar Funktioniert, aber seit 3.6 habe ich auch nur leeren Content.

Da scheint sich noch irgenwo etwas geändert zu haben...

### [#10](https://www.typo3.net/d/11878-player-profile-basic/10) · ffr_dev · 2004-06-03

> **zero schrieb:**
>
> Benutzt du Typo 3.5 oder Typo 3.6?
> Falls du 3.6 benutzt, ich habe das selbe Problem.
>
> Mit Typo 3.5 hat alles wunderbar Funktioniert, aber seit 3.6 habe ich auch nur leeren Content.
>
> Da scheint sich noch irgenwo etwas geändert zu haben...

ich benutze 3.6, aber ich kann leider nicht zurück.
da ich css_styled_content installiert hab und der in 3.5
nur unbefriedigend funktioniert.

jetzt ist nur die frage, was hat sich in 3.6 alles geändert das dieses beispiel nicht funktioniert??

### [#11](https://www.typo3.net/d/11878-player-profile-basic/11) · TW · 2004-06-03

hi
meines erachtens hat dieses beispiel noch nie richtig funktioniert...
aber ist nur meine meinung #giggle#

ne mal im ernst.......
schau mal auf typo3.org nach einer api vom typo3 3.6......

da sollte auch beschrieben stehen wie du ne vernünftige query schreibst!

cu
thorsten

### [#12](https://www.typo3.net/d/11878-player-profile-basic/12) · ffr_dev · 2004-06-03

ok, ich hab vorhin noch ein posting zu diesem thema endteckt, aber auch damit hats bei mir nicht funktioniert.
ist warscheinlich alles für 3.5 bestimmt, oder wie du schon sagtest, das beispiel funktioniert nicht o.O

na dann schau ich mal auf .org vorbei...

danke

---

Quelle: „player profile basic“, typo3.net, https://www.typo3.net/d/11878-player-profile-basic
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
