TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,219
  • Total Topics: 21,352
  • Online today: 556
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online

php block question

Started by redone, June 04, 2005, 04:00:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

redone

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.

IchBin

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'];

redone

Thanks a lot. I am just starting to experiment so your help is appreciated!

;)

IchBin


snowcrash

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

burglar

in your style.css

put the following

.ssi_table

{
font-family: verdana;
font-size: 10px;
color: #000000;
background-color: #f0f0f0;
}


something simmilar

snowcrash

#6
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

burglar

this works only with the ssi_functions

look at your forum/ssi_examples.php for some examples !!

snowcrash

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

Bjørn

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.

This website is proudly hosted on Crocweb Cloud Website Hosting.