*

Recent

Author Topic: Help adding something to the homepage  (Read 5900 times)

andrew

  • Newbie
  • *
  • Posts: 36
  • Force: +0/-0
Help adding something to the homepage
« on: December 31, 2009, 04:46:47 PM »
How can i get a box on the homepage, which displays welcome text? (above the games) as at the moment the site looks rather unwelcoming :)
http://tcxgames.com  My arcade.

[Donated]

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: Help adding something to the homepage
« Reply #1 on: December 31, 2009, 06:24:30 PM »
The file to edit is base_home.php in the template folder.

It may interest you to know that this is already something being thought out in a future update at some point in time. The idea is to be able to change the welcome text box from the admin panel, or even display site news there. There are a couple of new features that a lot of people want though that we are planning on working out first, so it might be a while for that one.

andrew

  • Newbie
  • *
  • Posts: 36
  • Force: +0/-0
Re: Help adding something to the homepage
« Reply #2 on: January 01, 2010, 11:05:33 AM »
Sorry to bother, but can i have help on how to create a text box? I also want to put one on most played and newest :D
http://tcxgames.com  My arcade.

[Donated]

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: Help adding something to the homepage
« Reply #3 on: January 01, 2010, 11:17:11 AM »
Try something like this:
Code: [Select]
echo "<div class='header2'>TEXT BOX</div>
<div class='content2'>TEXT GOES HERE</div>
<br>";
and just add it to the top of the page you want it in, see if that works..

EDIT:
make sure its after the <?PHP of course though

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: Help adding something to the homepage
« Reply #4 on: January 01, 2010, 11:57:56 AM »
Yea, that should work. If you're using a standard template then you would probably want to wrap it in table row and table content tags if it needs some blending in, but the above example that Adam gave is what you're after. You could also put the table structure in place and then use an include() to bring the text in from a separate file. A separate file might make it easier to edit from time to time.

If you need more secific help, then we will need to know if you want all 3 pages to display the same text or different, and we could work out  something more specific to post I suppose.

andrew

  • Newbie
  • *
  • Posts: 36
  • Force: +0/-0
Re: Help adding something to the homepage
« Reply #5 on: January 01, 2010, 12:34:40 PM »
Although that looks OK, i meant just above all the game in its own box, but below the header
http://tcxgames.com  My arcade.

[Donated]

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: Help adding something to the homepage
« Reply #6 on: January 01, 2010, 12:44:28 PM »
Not quite sure what you're asking for then. Where exactly are you wanting it? Above all the game category boxes? Or in the header part of each category? Or above each game as it's played? You looking for it to be in the header above the menu? What it sounded like is you wanted  it below the header menu, but above the collection of category boxes. If we are getting this wrong we would need for you to explain it to us a bit more precisely.

andrew

  • Newbie
  • *
  • Posts: 36
  • Force: +0/-0
Re: Help adding something to the homepage
« Reply #7 on: January 01, 2010, 12:52:01 PM »
I've come quite close to it here, thanks for the help starting it :)

http://tcxgames.com/ Does that look alright?
http://tcxgames.com  My arcade.

[Donated]

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: Help adding something to the homepage
« Reply #8 on: January 01, 2010, 12:59:27 PM »
Looks better than the first attempt, but you might still want to wrap it in the existing table for a little bit better fit.

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: Help adding something to the homepage
« Reply #9 on: January 01, 2010, 01:08:11 PM »
Here, try this way....

Here is the top few lines of base_home.php

Code: [Select]

<?php

$pagetitle 
$sitename;

function 
writebody() {
global 
$db$domain$sitename$domain$template$gamesfolder$thumbsfolder$limitboxgames$seo_on$blogentriesshown$enabledcode_on$comments_on$directorypath$autoapprovecomments$gamesonpage$abovegames$belowgames$showwebsitelimit$supportemail$showblog$blogentriesshown$blogcharactersshown$blogcommentpermissions$blogcommentsshown$blogfollowtags$blogcharactersrss$usrdata$userid;



$count 0;

$baser2 "SELECT * FROM dd_categories where active='1'";
$baser1 sqlcache('mainpagecats'$cachelife$baser2);


echo 
'<table width=\'99%\' border=\'0\' cellpadding=\'0\' cellspacing=\'0\'  align=\'center\'>';
foreach(
$baser1 as $row){




Between those last 2 lines, after the table tag, but before the foreach, add this in

Code: [Select]

echo '
<tr>
<td class=\'header\' colspan=\'2\' >Message Box Name</td>
</tr>
<tr>
<td class=\'content\' colspan=\'2\' >Text Message</td>
</tr>
';




to make it look like this

Code: [Select]

<?php

$pagetitle 
$sitename;

function 
writebody() {
global 
$db$domain$sitename$domain$template$gamesfolder$thumbsfolder$limitboxgames$seo_on$blogentriesshown$enabledcode_on$comments_on$directorypath$autoapprovecomments$gamesonpage$abovegames$belowgames$showwebsitelimit$supportemail$showblog$blogentriesshown$blogcharactersshown$blogcommentpermissions$blogcommentsshown$blogfollowtags$blogcharactersrss$usrdata$userid;



$count 0;

$baser2 "SELECT * FROM dd_categories where active='1'";
$baser1 sqlcache('mainpagecats'$cachelife$baser2);


echo 
'<table width=\'99%\' border=\'0\' cellpadding=\'0\' cellspacing=\'0\'  align=\'center\'>';

echo 
'
<tr>
<td class=\'header\' colspan=\'2\' >Message Box Name</td>
</tr>
<tr>
<td class=\'content\' colspan=\'2\' >Text Message</td>
</tr>
'
;

foreach(
$baser1 as $row){






and see if that looks like a better fit.
« Last Edit: January 01, 2010, 01:30:21 PM by Prankster »

andrew

  • Newbie
  • *
  • Posts: 36
  • Force: +0/-0
Re: Help adding something to the homepage
« Reply #10 on: January 01, 2010, 01:21:21 PM »
hmm, but this way it only covers half the width :P
http://tcxgames.com  My arcade.

[Donated]

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: Help adding something to the homepage
« Reply #11 on: January 01, 2010, 01:31:56 PM »
Yea...... doesn't work so well when I get typos in there lol.

I left off a couple "/" and mispelled "colspan" as "copspan". I edited, try it again. Sorry bout that, still waking up.

andrew

  • Newbie
  • *
  • Posts: 36
  • Force: +0/-0
Re: Help adding something to the homepage
« Reply #12 on: January 01, 2010, 01:41:09 PM »
Ah, there we go, thanks it belnds in now :) :D
http://tcxgames.com  My arcade.

[Donated]