Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Resolved] Display name not Username
#20
In my functions.php, I have this code :
PHP Code:
if (file_exists(GSUSERSPATH.$data_index->author.'.xml')) {
    
$data getXML(GSUSERSPATH.$author.'.xml');
    
$NAME stripslashes($data->NAME);


In my template.php file, I have this code :
PHP Code:
<p>Auteur : <?php echo $NAME?></p> 

Nothing is displayed and I have two errors :
PHP Code:
NoticeUndefined variableauthor in /Users/mymac/Sites/gs-site/theme/mytheme/functions.php on line 51
Notice
Trying to get property of non-object in /Users/mymac/Sites/gs-site/theme/mytheme/functions.php on line 52 

The line 51 : $data = getXML(GSUSERSPATH.$author.'.xml');
The line 52 : $NAME = stripslashes($data->NAME);
Français et éternel débutant
French and eternal beginner
Reply


Messages In This Thread
RE: Display name not Username - by Psychosopher - 2013-02-21, 08:22:30
RE: Display name not Username - by krysttof - 2013-02-21, 16:02:24
RE: Display name not Username - by WebDevandPhoto - 2013-02-21, 16:14:48
RE: Display name not Username - by Psychosopher - 2013-02-21, 22:14:35
RE: Display name not Username - by krysttof - 2013-02-21, 22:45:59
RE: Display name not Username - by shawn_a - 2013-02-21, 23:59:13
RE: Display name not Username - by krysttof - 2013-02-22, 00:05:10
RE: Display name not Username - by WebDevandPhoto - 2013-02-23, 16:00:12
RE: Display name not Username - by shawn_a - 2013-02-24, 00:50:14
RE: Display name not Username - by krysttof - 2013-03-08, 23:47:50
RE: Display name not Username - by shawn_a - 2013-03-09, 02:58:20
RE: Display name not Username - by krysttof - 2013-03-09, 18:47:16
RE: Display name not Username - by krysttof - 2013-04-04, 17:01:43
RE: Display name not Username - by shawn_a - 2013-04-04, 23:29:53
RE: Display name not Username - by shawn_a - 2013-04-04, 23:49:06
RE: Display name not Username - by shawn_a - 2013-04-05, 00:00:39
RE: Display name not Username - by krysttof - 2013-04-05, 16:41:25
RE: Display name not Username - by shawn_a - 2013-04-05, 22:51:28
RE: Display name not Username - by krysttof - 2013-04-06, 00:36:34
RE: Display name not Username - by shawn_a - 2013-04-06, 00:39:17
RE: Display name not Username - by D.O. - 2020-12-29, 03:36:20
RE: Display name not Username - by krysttof - 2013-04-06, 00:44:15



Users browsing this thread: 1 Guest(s)