Lisa, the Simpson!
December 02, 2008, 01:22 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 Add Site
 
   Home   Galleries Library Help Login Register  
Pages: 1 [2]  All
  Print  
Author Topic: Gary's Unofficial Guide to SMF  (Read 2992 times)
Andreas
Hero Member
*
Offline Offline

Gender: Male
Posts: 509

WWW
« Reply #15 on: September 28, 2007, 11:55 »

Hmm, I tried this and that in order to avoid the constant error messages, but it still doesn't work.  Sad At the moment, my code looks like this ( replaced the "array = ..." with "array(..." at the beginning, because that appeared to be the wrong syntax):

<?php
array(ssi_recentTopics($num_recent = 5, $exclude_boards = array(1, 2, 3, 4, 5, 6, 7, 9, 10), $output_method = 'array'));
foreach (
$array as $topic)
echo
'
<a href="'
, $topic['href'], '">', $topic['subject'], '</a> ', $topic['time'], '
'
;
?>

Well, my news page is displayed again, but there's still an error with the "foreach" line, it looks like this at the moment...
Logged

Andreas
Suusje
The Saxophonist
Hero Member
*
Offline Offline

Gender: Male
Posts: 577
WWW
« Reply #16 on: September 28, 2007, 12:06 »

Yeah, that's probably because $array is undefined now. Try

<?php
$array
= array(ssi_recenTopics.........
Logged

KANG *to Marge*: You look lovely this evening. Have you decreased in mass?

[ The Grabpics Thread | Cutest Lisa Moments ]
Dagdamor
Lisahugger
Administrator
*
Offline Offline

Gender: Male
Posts: 2551

WWW
« Reply #17 on: September 28, 2007, 12:26 »

Andreas
Suusje
Yay PHP madness Big Grin
Dunno why Gary included that "array = ..." in the beginning of his example, it invalidates the whole block. The same about assignments in the function's arguments list, they shouldn't be there. Here is a more believable fragment:

$topics = ssi_recentTopics(5, array(1, 2, 3, 4, 5, 6, 7, 9, 10), 'array');
foreach (
$topics as $topic) echo '...';

Although I haven't tested it as well.
Logged

When the power of love overcomes the love of power, the world will know peace. - Jimi Hendrix
Gazmanafc
SMF Customiser
Hero Member
*
Offline Offline

Gender: Male
Posts: 1071

There can be only one Snake and one Big Boss
WWW
« Reply #18 on: September 28, 2007, 12:44 »

^ that should work.

but do lay it out better than that for your own personal reference to make it easier on yourself. Wink
Logged

Andreas
Hero Member
*
Offline Offline

Gender: Male
Posts: 509

WWW
« Reply #19 on: September 28, 2007, 12:46 »

Thanks for the help, guys! It seems to work now, I only had to format the output a bit. Smile

http://www.sternwarte-kreuznach.de/news.php
Logged

Andreas
Dagdamor
Lisahugger
Administrator
*
Offline Offline

Gender: Male
Posts: 2551

WWW
« Reply #20 on: September 28, 2007, 12:52 »

Andreas
English instructions ruined! Must use German! "Registrieren"? What the hell is that?!
...sorry Big Grin Congratulations with the first experience in PHP Smile
Logged

When the power of love overcomes the love of power, the world will know peace. - Jimi Hendrix
Andreas
Hero Member
*
Offline Offline

Gender: Male
Posts: 509

WWW
« Reply #21 on: September 28, 2007, 13:02 »

Well, it's not my first PHP experience, because I had to mess with the integration of some mods already (such as adding a gallery link to the German navigation template), but all I can do is copying code and modifying the contents. As for writing functions etc., I'm completely lost (and I won't learn that ever Rolls Eyes ).
Logged

Andreas
Suusje
The Saxophonist
Hero Member
*
Offline Offline

Gender: Male
Posts: 577
WWW
« Reply #22 on: September 28, 2007, 13:11 »

Dagdamor
Big Grin

Andreas
You'll learn it eventually. If you're interested in it, that is. Wink
Logged

KANG *to Marge*: You look lovely this evening. Have you decreased in mass?

[ The Grabpics Thread | Cutest Lisa Moments ]
Pages: 1 [2]  All
  Print  
 
Jump to:  

Powered by SMF 1.1 RC3 | SMF © 2001-2006, Lewis Media