1
ljmyers
Help Editing PHP - Recette Module
  • 2007/4/4 11:11

  • ljmyers

  • Just popping in

  • Posts: 44

  • Since: 2006/1/4 2


I wasn't quite sure where to put this so my apologies if in the wrong place.

In the recette (recipe) module I want to take the following php code and turn it in to a php if statement.

echo 'From the kitchen of '.$story->uname().'
';


I want it to have an output of From the kitchen of MyOnlineMagazine.net if the user who contributed the recipe was not a registered user.
-or-
From the kitchen of The User's Name Here as the code is currently written.

Could some one please help me with this code as I am afraid I cannot make it work. For an example see Almost Homemade Strawberry Short Cake. Any other suggestions/comments are always welcome as well.

Thanks up front,
Lana
Smiles,
Lana
MyOnlineMagazine .net
L.J. Myers Company (My first website)

2
zyspec
Re: Help Editing PHP - Recette Module
  • 2007/4/4 14:11

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


NOTE: I haven't tried this - but this should work...

Somewhere near the top of the file you're changing you need to make sure you add
global $xoopsConfig;
if it isn't there already.

Then you can replace the line you showed above with:
$from_user = ($story->uid() == 0) ? $xoopsConfig['sitename'] : $story->uname() ;
echo 
'From the kitchen of '.$from_user.'
';

3
ljmyers
Re: Help Editing PHP - Recette Module
  • 2007/4/4 14:30

  • ljmyers

  • Just popping in

  • Posts: 44

  • Since: 2006/1/4 2


Thanks so much for the time it took for you to work that out for me zyspec. It did work exactly as I wanted.
Smiles,
Lana
MyOnlineMagazine .net
L.J. Myers Company (My first website)

Login

Who's Online

380 user(s) are online (291 user(s) are browsing Support Forums)


Members: 0


Guests: 380


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits