TinyPortal

Development => Block Codes => Topic started by: Crip on October 31, 2006, 02:01:31 PM

Title: Re: World Weather Block
Post by: Crip on October 31, 2006, 02:01:31 PM
1 way to find out is, install the script..so I'll let you know..

Aku -?
this isn't not related to weather block..
Do you know PHPMYSQL fairly good?  .. I need to add a custom Table on my smf Themes Demo Viewer - [Theme=name Theme=ID]??
Title: Re: World Weather Block
Post by: akulion on October 31, 2006, 02:09:00 PM
oh im terrible at that stuff
its best u ask jp, ja or thurnok

also be sure to check there arent similarlynamed tables :up:
Title: Re: World Weather Block
Post by: JPDeni on October 31, 2006, 03:15:42 PM
What do you need, exactly, crip? I make new tables all the time. :)
Title: Re: World Weather Block
Post by: Crip on October 31, 2006, 04:55:28 PM
Hi JP,
I really I'm not sure of the code or whatever, but maybe you can look at Gaia's SMF Theme viewer and see if you can tell by it..she was suppose to help me out..but, no pm yet..
http://mysmfthemes.com/theme_viewer.php

It's in Frames, a top.php and a theme_viewer.php -=- and a script to call theme;name;theme;id; ?
some code I think?
<?php

//
// This is the top of the demo
// Has a dropdown box of all the themes
// People can choose which theme they want to view
// And the theme changes in the bottom frame
//
// v1.0
// April 2006
//

include("mysql.php");

$result mysql_query("SELECT demo_id,name FROM files ORDER BY id DESC") or die(mysql_error());

while ( 
$file mysql_fetch_array($result) ) {
  
  
$list .= '<option value="'.$file['demo_id'].'">'.$file['name'].'</option>';
  
}

mysql_close();

?>

I appericate any help. :)
Title: Re: World Weather Block
Post by: JPDeni on October 31, 2006, 05:44:37 PM
Go to phpMyAdmin and select your database. You should have a list of all of your tables on the left side of your screen and a bunch of text tab things across the top on the right side, followed by another list of all of your tables. Scroll down to the very bottom of the list and you should see

Create a new table on database [the name of your database]

In the "Name" field, type files and in the "Number of fields" field, type 3.

Click the "Go" button that's to the far right of the screen.

Now you'll have three rows of input boxes.

In the first row, under "Field", type id. In the "Type" field, select INT. Go over to the "Extra" field and select auto_increment and then click in the radio button under the column that has the picture of the key in it. Leave the rest as they are.

In the second row, under "Field" type demo_id. In the "Type" field, select INT. You don't have to change anything else in the row.

In the third row, under "Field," type name and in the "Type" field, select tinytext. You don't have to change anything else in the row.

Those are the fields. Now you have to figure out what to put in them. :)
Title: Re: World Weather Block
Post by: Crip on October 31, 2006, 05:48:26 PM
Thank you JP..
I'm going to try that now..if I have problems may i contact you for assistance?
Title: Re: World Weather Block
Post by: JPDeni on October 31, 2006, 05:49:26 PM
You bet. I don't think you'll have a problem, but if you do, just holler.
Title: Re: World Weather Block
Post by: Crip on October 31, 2006, 06:05:11 PM
Now do I click save or Go?
Title: Re: World Weather Block
Post by: Crip on October 31, 2006, 06:10:31 PM
Save) i reckon..seems logical ;)
Title: Re: World Weather Block
Post by: JPDeni on October 31, 2006, 06:11:33 PM
Sorry. I forgot to continue with it.

Click "Save."

:) You figured it out.  :) "Go" would add another field
Title: Re: World Weather Block
Post by: Crip on October 31, 2006, 06:19:53 PM
Done i reckon..look correct JP?
Clicky:
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fimages6.theimagehosting.com%2Ftable.052.th.jpg&hash=83aab4a299ef39cdeb62c4d9ad9ddf56f0ee02dd) (http://server6.theimagehosting.com/image.php?img=table.052.jpg)
Title: Re: World Weather Block
Post by: JPDeni on October 31, 2006, 06:26:03 PM
That's it. :) Now you need to populate it. Click on the table name in the left column and then click the "Insert" link on the main part of the page. Enter the demo_id number and the name of the theme for each of your themes. The id field will take care of itself. Each time you fill in the fields for a whole record, you'll click the "Go" button at the bottom of the page.
Title: Re: World Weather Block
Post by: Crip on October 31, 2006, 06:52:10 PM
Like this JP?
Clicky -
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fimages6.theimagehosting.com%2Ffield.e51.th.jpg&hash=baa77b7fbdf0d925f6cf3f11e1b01b73ad913eb9) (http://server6.theimagehosting.com/image.php?img=field.e51.jpg)
Title: Re: World Weather Block
Post by: JPDeni on October 31, 2006, 07:01:13 PM
No.

Leave the "id" field empty. That's a number that will be filled in by the script.

Put the text in the "name" field. The demo_id field is fine, if the demo id for the default theme is "1". :)
Title: Re: World Weather Block
Post by: Crip on October 31, 2006, 07:03:49 PM
I already clicked Go...did i mess up?  :'(
Title: Re: World Weather Block
Post by: JPDeni on October 31, 2006, 07:06:01 PM
It likely gave you an error, but it's nothing that you can't fix. Click the "Browse" button on the tabs across the top. Then, look below for the record. There'll be a pencil by it. Click the pencil and you can edit the record.
Title: Re: World Weather Block
Post by: Crip on October 31, 2006, 07:28:05 PM
OK JP,
I deleted it all and re-done it again repeating the steps you gave, no errors while addind it all.. this is the final:
Does it look correct?

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fimages6.theimagehosting.com%2Fbrowse.379.th.jpg&hash=3079f5a4d2f4b4376b9b9ffe4380a1eb85b1d8ab) (http://server6.theimagehosting.com/image.php?img=browse.379.jpg)
Title: Re: World Weather Block
Post by: JPDeni on October 31, 2006, 07:34:23 PM
Yep. :) It looks fine. See? Now you have another whole skill set!! ;D
Title: Re: World Weather Block
Post by: Crip on October 31, 2006, 07:38:27 PM
You know what I've learned??

Nuttin honey, positively nuttin. ;D

anywho, Thank you JPDeni. :)
Title: Re: World Weather Block
Post by: Crip on October 31, 2006, 07:39:59 PM
Aku --
sorry for Hijacking your Thread..split it if you want. :)
Title: Re: World Weather Block
Post by: Crip on October 31, 2006, 09:25:01 PM
It's works Grrreat JPDeni!! :up:

- Crip's SMF Theme Viewer (http://www.cripcan.com/mysmfthemes/themeviewer.php)

I get by with a little help from my friends... :)
The Beatles :coolsmiley:
Title: Re: World Weather Block
Post by: JPDeni on October 31, 2006, 11:03:55 PM
I'm glad to help, crip. ;D Looks wonderful
Title: Re: World Weather Block
Post by: akulion on October 31, 2006, 11:10:11 PM
yea it looks great!! :up:
Title: Re: World Weather Block
Post by: Xarcell on November 01, 2006, 04:52:10 PM
Please don't hi-jack the thread.