Welcome to Geeklog, Anonymous Monday, December 23 2024 @ 11:05 am EST

Geeklog Forums

Display HELP!


Anonymous

Anonymous
I have a script: <? require ('../lib-common.php'); $display = COM_siteHeader(); $display .= COM_startBlock(); include("music_functions.php"Wink; switch($view) { case songs: get_songs(); break; case albums: get_albums(); break; case bands: get_bands(); break; default: $abc="A"; get_bands($abc); break; } $display .= COM_endBlock($template='blockfooter.thtml'); $display .= COM_siteFooter($rightblock = false); ?> I've used display function like Dirk told me but it only shows header and left blocks..it doesnt show the footer and the blocks on the right...help please..
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Actually, I'm surprised it's displaying anything at all ... At least the code you posted is missing a echo $display; at the end of the script. The idea is to add all output to the string $display first and then output it all at once. Of course, you could rewrite that to output things immediately, e.g. echo COM_siteHeader ('menu'); etc. bye, Dirk
 Quote

Anonymous

Anonymous
i've put the echo $display; at the end of that code and still right blocks aren't diaplying if i remove those things from brackets..help please
 Quote

Status: offline

tomw

Forum User
Full Member
Registered: 08/12/02
Posts: 300
You did not tell us what getsongs() etc did. Do they return html or do they echo the content themselves? If they do not return html then the script should be: <? require ('../lib-common.php'); echo COM_siteHeader(); echo COM_startBlock(); include("music_functions.php"Wink; switch($view) { case songs: get_songs(); break; case albums: get_albums(); break; case bands: get_bands(); break; default: $abc="A"; get_bands($abc); break; } echo COM_endBlock(); echo COM_siteFooter(true); ?> If they return html then the script should be: <? require ('../lib-common.php'); $display = COM_siteHeader(); $display .= COM_startBlock(); include("music_functions.php"Wink; switch($view) { case songs: $display .= get_songs(); break; case albums: $display .= get_albums(); break; case bands: $display .= get_bands(); break; default: $abc="A"; $display .= get_bands($abc); break; } $display .= COM_endBlock(); $display .= COM_siteFooter(true); echo $display; ?> The later is the Geeklog way. If you do not want right blocks then use Com_siteFooter(). Tom
 Quote

Anonymous

Anonymous
/* This function pulls out the band names in your collection*/ function get_bands() { global $aid,$album_name,$band,$id,$image,$purchase,$abc; connect_db(); $result = mysql_query("select id,band from bands where band like '$abc%' order by band asc"Wink or die (mysql_error()); echo"<p><p>"; abc_links(); while ($row = mysql_fetch_array($result)) { $id=$row['id']; $band = $row['band']; $band = "<a href=\"$PHP_SELF?id=$id&band=$band&view=albums\">$band</a>"; echo "$band<br>"; } } /* This function pulls out the album names of corrasponding band */ function get_albums() { global $aid,$album_name,$band,$id,$image,$purchase; connect_db(); $result = mysql_query("select albums.album_id,albums.text,albums.album_name,albums.aid,albums.image,albums.purchase,bands.id from albums as albums,bands as bands where albums.album_id= bands.id and albums.album_id=$id order by album_name"Wink or die (mysql_error()); abc_links(); echo stripslashes("<center><h1>$band albums</h1></center>"Wink; while ($row = mysql_fetch_array($result)) { $aid=$row['aid']; $album_name=$row['album_name']; $image=$row['image']; $purchase=$row['purchase']; $bodytext=$row['text']; if($image==""Wink { $image=""; } else { $image="<img src=images/$image.jpg align=left>"; } $album_name="<a href=\"$PHP_SELF?view=songs&aid=$aid&album_name=$album_name&band=$band&id=$id&image=$image&purchase=$purchase\"> $album_name</a>"; echo '<table width="100%" height="208" border="0"><tr><td><div align="justify">'; echo stripslashes("$album_name<br><br>$bodytext<br>"Wink; echo '</td></tr></table>'; } } function get_songs() { global $aid,$album_name,$band,$id,$image,$purchase; connect_db(); $result = mysql_query("select songs.text,songs.song_id,songs.song_name,albums.aid from songs as songs,albums as albums where songs.song_id = albums.aid and songs.song_id = $aid order by id"Wink or die (mysql_error()); echo stripslashes("<center><h1>Songs of $album_name</h1></center>"Wink; $links=stripslashes(" <a href=\"$PHP_SELF\">Start</a> | <a href=\"$PHP_SELF?view=albums&band=$band&id=$id\">$band Index</a> $purchase "Wink; echo "$links<hr>"; echo "$image"; echo "<table width=\"80%\">"; $num=mysql_num_rows($result); for($i=1;$i<=$numWink { while ($row = mysql_fetch_array($result)) { $song_text=$row['text']; echo "<tr><td width=\"6%\" align=\"center\">$i.</td><td>$song_text</td></tr>"; $i++; } } echo"</table>"; echo "<br><hr>$links"; }
 Quote

Anonymous

Anonymous
if you go to pcgamers.ru/cheats u'll see the start of the block right after the list of words..see that? what might have caused this issue?
 Quote

Anonymous

Anonymous
According to the html from your site, you are calling the COM_startBlock after you call your getsong() functions. Check the squence of events.
 Quote

Anonymous

Anonymous
thanks for your help..its working beautifuly now
 Quote

All times are EST. The time is now 11:05 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content