i know pretty much nothing about php but could someone tell me how I would enter this in a php block for the portal?
<?php echo $_SERVER['HTTP_USER_AGENT']; ?>
Its very simple piece of code but whatever settings I have tried nothng works. I have searched and searched but still nothing!
Thanks.
Only thing you don't need when entering php in a block is the php script tag. So it should look like this.
echo $_SERVER['HTTP_USER_AGENT'];
Thanks a lot. I am just starting to experiment so your help is appreciated!
;)
no prob
A related question when using the phpbox: how do you format a ssi_ call?
So for example, if you wanted to use ssi_topPoster(); - how would you specify the font style (type, size, etc) for the output?
thanks
in your style.css
put the following
.ssi_table
{
font-family: verdana;
font-size: 10px;
color: #000000;
background-color: #f0f0f0;
}
something simmilar
Thanks for the info burglar
I changed font size etc. & put this in the style.css of my default theme, which is the only one I use.
But had no effect of the text display of the phpbox - any ideas?
Bascially, I'm trying to format the text so it looks similar to the other default boxes available, such as recent topics.
regards
this works only with the ssi_functions
look at your forum/ssi_examples.php for some examples !!
Hi
I'm trying it with:
ssi_topPoster();
ssi_topTopicsViews();
Unless I'm missing something, these belong to the ssi_functions?
Also, in a newly created phpbox on the TP, I'm just putting in the function, eg.
ssi_topTopicsViews(5);
straight into the box, and no other code - does something else have to be added
thanks
You should be fine with just typing it as it is.
As for adjusting its output, I suggest fetching it into an array , and doing things with that. For ssi_topPoster() that would mean:
$my_top=ssi_topPoster(10, 'array');
foreach($my_top as $my){
echo '<b>'.$my['link'].'</b><br />';
}
The same applies for ssi_topTopicsviews()
$my_view=ssi_topTopicsViews(10, 'array');
foreach($my_view as $my){
echo '- '.$my['link'].' ( '.$my['num_views'].' )<br />';
}
In the last you add the number of views like I did, even number of replies with this method.