Author |
Message |
thebishop
Worker


Joined: Aug 30, 2005
Posts: 244
Location: Flying to close to the sun
|
Posted:
Fri Dec 15, 2006 7:20 pm |
|
Hey all, i was wondering if there are any apps for nuke that make adding downloads fast and easy. i have over 700 downloads to add to my site and i need to be able to just dump them into nuke with just a simple title.
thanks. |
|
|
|
 |
fkelly
Former Moderator in Good Standing

Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY
|
Posted:
Fri Dec 15, 2006 7:31 pm |
|
I don't have time to look now but there may be something in Karakas' manual. Check Only registered users can see links on this board! Get registered or login! and find his HowtoManual and look in there. |
|
|
|
 |
Gremmie
Former Moderator in Good Standing

Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA
|
Posted:
Fri Dec 15, 2006 8:51 pm |
|
I converted my 200 or so weblinks from my old static html site by writing a perl script to read the html and turn that into SQL insert statements.  |
_________________ Only registered users can see links on this board! Get registered or login! - An Event Calendar for PHP-Nuke
Only registered users can see links on this board! Get registered or login! - A Google Maps Nuke Module |
|
|
 |
thebishop

|
Posted:
Fri Dec 15, 2006 9:50 pm |
|
|
|
 |
thebishop

|
Posted:
Sat Dec 16, 2006 12:08 am |
|
|
|
 |
montego
Site Admin

Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Sat Dec 16, 2006 6:35 am |
|
I've even used Excel to create INSERT statements from columns of data. Crude, but it works if that is a tool you are comfortable using. Just make sure on the autoincrement fields to pass '' as the value. |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
 |
thebishop

|
Posted:
Sat Dec 16, 2006 7:44 am |
|
I know nothing about excel. I still haven't gotten this to work. |
|
|
|
 |
thebishop

|
Posted:
Thu Dec 21, 2006 10:48 am |
|
I did finally get this script to work, except when i try to INSERT the data into my sql, it gives me the following error.
"Column count doesn't match value count at row 1"
here is the sql syntax i'm using for the inserts.
Code:insert into nuke_downloads_downloads values (NULL, '2', '0', 'winmtr', 'http://www.mysite.com/downloads/pc_utilities/winmtr.exe', 'pc tools', now(), 'mysuername', 'webmaster@mysite.com', '0','0','0','0', '0', '', 'http://www.mysite.com');
|
any help appreciated. |
|
|
|
 |
Guardian2003
Site Admin

Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Thu Dec 21, 2006 10:53 am |
|
That would seem to indicate the number of fields in the table is different to the number of fields you are trying to INSERT - you might want to count them again to be sure. |
|
|
|
 |
thebishop

|
Posted:
Thu Dec 21, 2006 5:40 pm |
|
I'm confuzored, i think i get what your saying but which variable from the code above refers to the number of fields im trying to insert and which variable refers to the number of tables. the downloadadd.php script didnt say anything about having to alter colums or rows in a table before using it.
it just said put it in the nuke root and add the info needed then point it to the folder with your downloads in it and call the path too the downloadadd.php script in your browser. it then spit out that code from above and all im supposed to do is import it to mysql. |
|
|
|
 |
kguske
Site Admin

Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Thu Dec 21, 2006 8:28 pm |
|
I would suggest using phpMyAdmin to export the data so you get a valid insert statement. Then use a text editor (or Excel) to search / replace the SQL around your downloads to create a new set of SQL insert statements. You would need to change the ID number to make the new files unique (or, the ID field might be an autoindex field). |
_________________ I search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|
|
 |
thebishop

|
Posted:
Fri Dec 22, 2006 1:00 am |
|
I have no idea what the id number or id field looks like because i do not know mySQL. data?, what data should i be exporting.
I'll keep searching the net for an example and reading to learn more about this. thanks for the relpy kguske.
Its kinda hard if one does this in there spare time and has very little spare time. Right now im in the process of remodeling my entire home for a sale within two months. Cheers. |
|
|
|
 |
montego

|
Posted:
Fri Dec 22, 2006 7:02 am |
|
thebishop, kguske's suggestion is the best possible solution. You need to make sure your INSERT statements match up 100% with the structure of your nuke_downloads_downloads table. The best way to do this is to export one or more rows of data from that table using phpMyAdmin to give you a good model.
The first field in that table is an "autoincrement" field, so the first field in your INSERT statement must be ''. That is two single quotes. I believe that you could also use NULL, but I have not tested it. |
|
|
|
 |
kguske

|
Posted:
Fri Dec 22, 2006 11:20 am |
|
The ID field is the integer field that uniquely identifies each download.
You can export the structure and data for one or more tables in a database using phpMyAdmin. If you export the data, you will get an SQL insert statement for each of your existing downloads. Take one of those statements and replace the ID field, download location / file name, name and description for each of the 700 downloads you want to add. Obviously, it would be easier to do that with a text editor or Excel. Then, copy and paste the 700 insert statements into the SQL window of phpMyAdmin and execute. |
|
|
|
 |
thebishop

|
Posted:
Fri Dec 22, 2006 2:04 pm |
|
kguske wrote: | The ID field is the integer field that uniquely identifies each download.
You can export the structure and data for one or more tables in a database using phpMyAdmin. If you export the data, you will get an SQL insert statement for each of your existing downloads. Take one of those statements and replace the ID field, download location / file name, name and description for each of the 700 downloads you want to add. Obviously, it would be easier to do that with a text editor or Excel. Then, copy and paste the 700 insert statements into the SQL window of phpMyAdmin and execute. |
Ok thanks for explaining that to me kguske Also thanks montego.
But if i have to do it that way there is no point in using the script.
Using this script was supposed to make adding thousands of downloads easy. there has to be a way to simply run the script and do a mysql import and be done with it. |
Last edited by thebishop on Fri Dec 22, 2006 2:09 pm; edited 1 time in total |
|
|
 |
Gremmie

|
Posted:
Fri Dec 22, 2006 2:08 pm |
|
Well apparently your host doesn't let you use fopen, so the script doesn't work for you. We've given you several alternatives. You can try those or talk to your host about fopen. |
|
|
|
 |
thebishop

|
Posted:
Fri Dec 22, 2006 2:11 pm |
|
Gremmie, This is the first time i'm hearing about fopen, what is it.
i'm sure i can get my host to let me use it if i know what it is. thanks. |
|
|
|
 |
Gremmie

|
Posted:
Fri Dec 22, 2006 3:15 pm |
|
|
|
 |
thebishop

|
Posted:
Fri Dec 22, 2006 5:41 pm |
|
i am no longer seeing that message as my above post implies.
im having this problem now.
"Column count doesn't match value count at row 1" after using phpmyadmin to do the insert of the above data. |
|
|
|
 |
Gremmie

|
Posted:
Fri Dec 22, 2006 6:15 pm |
|
Oh sorry, wasn't paying attention. Then as the others have said you need to modify that script to match your new downloads table structure. |
|
|
|
 |
thebishop

|
Posted:
Sat Dec 23, 2006 1:38 am |
|
i dont know the first thing about how to write or modify a script.
I'm just reading a lot to try and get it to work. So far i haven't had any luck. |
|
|
|
 |
kguske

|
Posted:
Sat Dec 23, 2006 7:12 am |
|
Can you export the structure of your downloads table from phpMyAdmin? If so, we can show you how to modify the Karas script to work for your site. |
|
|
|
 |
thebishop

|
Posted:
Sat Dec 23, 2006 4:30 pm |
|
kguske, sorry it took so long to get back, family is in town for the holidays
ok here is the export from the nuke_downloads_downloads table.
do you also need to see the script. I am very surprised that this script has not been recoded to work with Nuke's current versions because so many sites could benefit from it's use. it could even be maid into a module, could it not.
thanks for your help kguske.
Code:
-- phpMyAdmin SQL Dump
-- version 2.9.0.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 23, 2006 at 11:34 AM
-- Server version: 4.1.21
-- PHP Version: 4.4.2
--
-- Database: `mydbname_central`
--
-- --------------------------------------------------------
--
-- Table structure for table `nuke_downloads_downloads`
--
CREATE TABLE `nuke_downloads_downloads` (
`lid` int(11) NOT NULL auto_increment,
`cid` int(11) NOT NULL default '0',
`sid` int(11) NOT NULL default '0',
`title` varchar(100) NOT NULL default '',
`url` varchar(100) NOT NULL default '',
`description` text NOT NULL,
`date` datetime default NULL,
`name` varchar(100) NOT NULL default '',
`email` varchar(100) NOT NULL default '',
`hits` int(11) NOT NULL default '0',
`submitter` varchar(60) NOT NULL default '',
`downloadratingsummary` double(6,4) NOT NULL default '0.0000',
`totalvotes` int(11) NOT NULL default '0',
`totalcomments` int(11) NOT NULL default '0',
`filesize` int(11) NOT NULL default '0',
`version` varchar(10) NOT NULL default '',
`homepage` varchar(200) NOT NULL default '',
PRIMARY KEY (`lid`),
KEY `lid` (`lid`),
KEY `cid` (`cid`),
KEY `sid` (`sid`),
KEY `title` (`title`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `nuke_downloads_downloads`
--
INSERT INTO `nuke_downloads_downloads` VALUES (1, 1, 0, 'dod1.3_enhancement_pack', 'http://mysite.com/homefries/dod_files/dod1.3_enhancement_pack.exe', 'the dod1.3_enhancement_pack includes an FPS & Ping booster as well as 16 custom crosshairs you can toggle through while playing,a custom VGUI for changing classes,font fixes for amxstats and also ingame wave files that have been reduced or amplified to make the game more pleasant to play.', '2006-11-24 13:41:49', 'ThePowerCosmic', 'Webmaster@mysite.com', 141, '', 0.0000, 0, 0, 13, '1.5 final', 'http://mysite.com');
|
|
|
|
|
 |
Guardian2003

|
Posted:
Sat Dec 23, 2006 5:06 pm |
|
Yep loks like your are one column out.
I'll download that script and see if I can modify it for you - seeing as its the season of good will and all that  |
|
|
|
 |
Guardian2003

|
Posted:
Sat Dec 23, 2006 5:13 pm |
|
No I just recounted the fields and they add up fine, hmm... |
|
|
|
 |
|