Help needed finding table placement on default theme header.

Started by sbarnes, April 18, 2006, 07:39:35 AM

Previous topic - Next topic

sbarnes

Hi there,
Have been looking at the index.template but just confuse myslef.

Please see picture attached.

I want to 'split the cell' that contains the logged in time, messages waiting etc into two columns.

Where I have put the X I want to put google adsense code (already have this).

I just cant work out the TR's TD's etc


1MileCrash

i dont see an image. if you can get me an image i will tell you what to do, i still dont understand exactly what you want.
The only thing php can't do is tell you how much milk is left in the fridge.



Deaks

look for
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo '
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/sha1.js"></script>

<form action="', $scripturl, '?action=login2" method="post" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">', $txt['smf53'], '</option>
<option value="1440">', $txt['smf47'], '</option>
<option value="10080">', $txt['smf48'], '</option>
<option value="302400">', $txt['smf49'], '</option>
<option value="-1" selected="selected">', $txt['smf50'], '</option>
</select>
<input type="submit" value="', $txt[34], '" /><br />
<span class="middletext">', $txt['smf52'], '</span>
<input type="hidden" name="hash_passwrd" value="" />
</form>';
}

echo '
</td><td>text here</td>
</tr>
</table>
</td>
</tr>
</table>';

See where I have text here replace that with you add, you will need t play with horizontal alignment :)
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

sbarnes


sbarnes

o.k I have got close but not quite close enough.
Here is the code I need to put in that gap you mentioned/ created:

//Ad management code to display ads on top of the menubar

if ($modSettings['ad_management_index_above'] && allowedTo('ad_manageperm'))
echo '<div align="',$modSettings['ad_management_align'],'">',$modSettings['ad_management_content'],'</div>';


I'm not good at php and played around with the ', ; etc and managed to get it to work but it looked messy.
Also the background colour of that cell was wrong.

How would I put the above code in place keeping the same background colour? Baring in mind I use the default theme and a colour change theme based on the default (seperate style.css)

Deaks

on the <td> tag where I said add the following class="windowbg" inside the tag
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

sbarnes

Thanks again sloopz,

I actually needed class="windowbg2" but hey same thing.

Thanks for your help, got it sorted thanks to you.

mrvegas

I am trying to do the same exact thing....
And this is teh error i get.

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in .../Themes/default/index.template.php on line 293

284: <input type="submit" value="', $txt[34], '" /><br />
285: <span class="middletext">', $txt['smf52'], '</span>
286: <input type="hidden" name="hash_passwrd" value="" />
287: </form>';
288: }
289:
290: echo '
291: </td>
292: <td>
293: if ($modSettings['ad_management_index_above'] && allowedTo('ad_manageperm'))294: echo '<div align="',$modSettings['ad_management_align'],'">',$modSettings['ad_management_content'],'</div>';</td>
295: </tr>
296: </table>
297: </td>


Have I done something wrong? I am not experianced in PHP at all... But I am trying to learn.
I am using RC2 and Default Theme.
thanks a ton for your help.

Mr Vegas

sbarnes

try moving the ;
to the end of that section in index.template so that it looks like this:
if ($modSettings['ad_management_index_above'] && allowedTo('ad_manageperm'))
echo '<div align="',$modSettings['ad_management_align'],'">',$modSettings['ad_management_content'],'</div>';
echo '</td>
</tr>
</table>
</td>
</tr>
</table>';


Sorry if this is not the answer you need but I needed to do something like that and it worked.

Advertisement: