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,970
  • Latest: bynw
Stats
  • Total Posts: 196,047
  • Total Topics: 21,336
  • Online today: 374
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 143
  • Total: 143

PHP & SQL basic help please ?

Started by fenris_w0lf, January 23, 2006, 10:37:58 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Rasyr

In the TP Admin area it is called an "Article".

As part of the URL it shows up as index.php?page=x, where x is the article number (in the case of your Ranks page, it is would be index.php?page=7

In general terms, what we did with the rank code is create an html page (all of the other things on the page, the menu, the sidebars, etc. are part of the page template).




fenris_w0lf

Yeah, I prolly didnt phrase my question well enough.

I'll try to explain what I'm asking for in another way. The question is really quite elementary, but usefull for me if I find the right word to use.

If you look at these forums right here, you'll see that its roughly built of major 4 "sections".

1) To the top theres a section with a logo some userinfo, timed logged in etc. 2) To the left there's a section filled with various blocks (such a section can also be placed on the right side - as it is on our TP) 3) At the bottom theres mysql, php links etc. 4) The centre section is right now, when we look at it filled with the forum.

Its the 4th section of the "Home page" (index.php) I want a "general name" for, since the content of it varies depending on where in TP you are (ie when going to the "Home page" its no longer filled with the forum, but could be news etc..)

Having a name for this section would prove useful to me when making posts like the first one in this topic where I wrote:

QuoteExample:
Adding a block with a link to a php file that will present the results from a select on the members table. When the users press this link - they should be taken to a page that looks much like the main home portal page, only with the memberslist in the centre (ie retain the themes etc automatically)

I could simply write:

QuoteExample:
Adding a block with a link to a php file that will present the results from a select on the members table and display it in the xxxxxx

And everyone would know what I was talking about, ie where I wanted the results presented :)

Rasyr

I guess you could call it the "Content Area" or the Body of the page.

The upper section being the Header, the left and right sections being the Sidebars, and the links at the bottom being the Footer.

fenris_w0lf

#33
Great thanks !!

(yet again!) :)

Easier to write this post now:

http://www.tinyportal.net/smf/index.php?topic=2298.0

:D

osquitar

Are there some functions or classes to use in PHP Articles with the database like Joomla API does?


Rasyr

TinyPortal allows for 2 different types of articles.

The first is normal, html articles.

The second  is PHP articles.

IIRC, only the Admin may do PHP Articles,

You can put any php you want in the PHP Articles.


osquitar

I was talking about what I saw in the article "PHP in articles":

This is a demonstration of a page using PHP for its output - and which is also an "article".It will use classes from SMF natively

I think there is a way to call some functions in SMS. For example: I have to connect to the database to retrieve my own tables. In PHP I would have to write the database password in the code and this is dangerous. I think there is a function of a class (database, perhaps) that let me to do this. What is "classes from SMS natively"?

bloc

"classes" meant there are CSS classes used in SMF.

Managing articles means also making php articles - so don't give that option out without trust.

The way to your dilemma is to include() the file with the passwords etc. That way it stays out of the stored code in TP. PHP articles are very basic..if you need custom OOP classes rather include them, and add them directly into the inserted code.

Rasyr

Additionally, if your own tables are part of the same database as SMF/TP, then you won't need to put that information into your code, it is already handled by sections of SMF code.

Look at the various files in the Sources directory to get an idea of how SMF and TP make database calls. You can use that code as your basis for making your own DB calls if you like.


This website is proudly hosted on Crocweb Cloud Website Hosting.