PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Author Message
thebishop
Worker
Worker


Joined: Aug 30, 2005
Posts: 243
Location: Flying to close to the sun

PostPosted: Fri Dec 15, 2006 7:20 pm Reply with quote Back to top

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.
View user's profile Send private message
fkelly
Moderator


Joined: Aug 30, 2005
Posts: 3186
Location: near Albany NY

PostPosted: Fri Dec 15, 2006 7:31 pm Reply with quote Back to top

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 to the forums!
and find his HowtoManual and look in there.
View user's profile Send private message Visit poster's website
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Fri Dec 15, 2006 8:51 pm Reply with quote Back to top

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. Smile
View user's profile Send private message
thebishop
Worker
Worker


Joined: Aug 30, 2005
Posts: 243
Location: Flying to close to the sun

PostPosted: Fri Dec 15, 2006 9:50 pm Reply with quote Back to top

i'm trying to get this script to work for my downloads and there is also one that works for links but i haven't taken a look at it yet.
Only registered users can see links on this board!
Get registered or login to the forums!


thanks for the replies
View user's profile Send private message
thebishop
Worker
Worker


Joined: Aug 30, 2005
Posts: 243
Location: Flying to close to the sun

PostPosted: Sat Dec 16, 2006 12:08 am Reply with quote Back to top

I am only getting this output from the downloadadd.php script

"couldn't connect to
Only registered users can see links on this board!
Get registered or login to the forums!
"

it is not outputting the list of downloads and the INSERT code for mysql insertion.
i'll keep trying things .
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9135
Location: Arizona

PostPosted: Sat Dec 16, 2006 6:35 am Reply with quote Back to top

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.
View user's profile Send private message Visit poster's website
thebishop
Worker
Worker


Joined: Aug 30, 2005
Posts: 243
Location: Flying to close to the sun

PostPosted: Sat Dec 16, 2006 7:44 am Reply with quote Back to top

I know nothing about excel. I still haven't gotten this to work.
View user's profile Send private message
thebishop
Worker
Worker


Joined: Aug 30, 2005
Posts: 243
Location: Flying to close to the sun

PostPosted: Thu Dec 21, 2006 10:48 am Reply with quote Back to top

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.
View user's profile Send private message
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6373
Location: Vsetin, Czech Republic

PostPosted: Thu Dec 21, 2006 10:53 am Reply with quote Back to top

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.
View user's profile Send private message Send e-mail Visit poster's website
thebishop
Worker
Worker


Joined: Aug 30, 2005
Posts: 243
Location: Flying to close to the sun

PostPosted: Thu Dec 21, 2006 5:40 pm Reply with quote Back to top

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.
View user's profile Send private message
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6044

PostPosted: Thu Dec 21, 2006 8:28 pm Reply with quote Back to top

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).
View user's profile Send private message
thebishop
Worker
Worker


Joined: Aug 30, 2005
Posts: 243
Location: Flying to close to the sun

PostPosted: Fri Dec 22, 2006 1:00 am Reply with quote Back to top

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.
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9135
Location: Arizona

PostPosted: Fri Dec 22, 2006 7:02 am Reply with quote Back to top

thebishop, kguske's suggestion is the best possible solution. Wink 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.
View user's profile Send private message Visit poster's website
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6044

PostPosted: Fri Dec 22, 2006 11:20 am Reply with quote Back to top

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.
View user's profile Send private message
thebishop
Worker
Worker


Joined: Aug 30, 2005
Posts: 243
Location: Flying to close to the sun

PostPosted: Fri Dec 22, 2006 2:04 pm Reply with quote Back to top

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 Wink 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
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Fri Dec 22, 2006 2:08 pm Reply with quote Back to top

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.
View user's profile Send private message
thebishop
Worker
Worker


Joined: Aug 30, 2005
Posts: 243
Location: Flying to close to the sun

PostPosted: Fri Dec 22, 2006 2:11 pm Reply with quote Back to top

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.
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Fri Dec 22, 2006 3:15 pm Reply with quote Back to top

fopen() is a PHP function. I am speculating you are seeing the error message "couldn't connect to
Only registered users can see links on this board!
Get registered or login to the forums!
" because the fopen failed. It may fail because either your host has it disabled, or that URL is not correct.

See
Only registered users can see links on this board!
Get registered or login to the forums!


and the setting for allow_url_fopen:
Only registered users can see links on this board!
Get registered or login to the forums!


Your host may have turned off allow_url_fopen in the php.ini file.
View user's profile Send private message
thebishop
Worker
Worker


Joined: Aug 30, 2005
Posts: 243
Location: Flying to close to the sun

PostPosted: Fri Dec 22, 2006 5:41 pm Reply with quote Back to top

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.
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Fri Dec 22, 2006 6:15 pm Reply with quote Back to top

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.
View user's profile Send private message
thebishop
Worker
Worker


Joined: Aug 30, 2005
Posts: 243
Location: Flying to close to the sun

PostPosted: Sat Dec 23, 2006 1:38 am Reply with quote Back to top

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.
View user's profile Send private message
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6044

PostPosted: Sat Dec 23, 2006 7:12 am Reply with quote Back to top

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.
View user's profile Send private message
thebishop
Worker
Worker


Joined: Aug 30, 2005
Posts: 243
Location: Flying to close to the sun

PostPosted: Sat Dec 23, 2006 4:30 pm Reply with quote Back to top

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');
View user's profile Send private message
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6373
Location: Vsetin, Czech Republic

PostPosted: Sat Dec 23, 2006 5:06 pm Reply with quote Back to top

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 Smile
View user's profile Send private message Send e-mail Visit poster's website
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6373
Location: Vsetin, Czech Republic

PostPosted: Sat Dec 23, 2006 5:13 pm Reply with quote Back to top

No I just recounted the fields and they add up fine, hmm...
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum