Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6
Author Message
thebishop
Worker
Worker



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

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

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
Former Moderator in Good Standing



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

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

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.
 
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

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

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







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

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.
http://www.karakas-online.de/EN-Book/enter-thousands-of-download-links.html

thanks for the replies
 
thebishop







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

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

"couldn't connect to http://www.mysite.com/homefries/downloads/pc_utilities/"

it is not outputting the list of downloads and the INSERT code for mysql insertion.
i'll keep trying things .
 
montego
Site Admin



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

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

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







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

I know nothing about excel. I still haven't gotten this to work.
 
thebishop







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

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

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

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
thebishop







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

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

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

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







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

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







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

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.
 
kguske







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

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







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

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 
Gremmie







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

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







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

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







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

fopen() is a PHP function. I am speculating you are seeing the error message "couldn't connect to http://www.mysite.com/homefries/downloads/pc_utilities/" because the fopen failed. It may fail because either your host has it disabled, or that URL is not correct.

See

http://us2.php.net/manual/en/function.fopen.php

and the setting for allow_url_fopen:

http://us2.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen

Your host may have turned off allow_url_fopen in the php.ini file.
 
thebishop







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

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







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

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







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

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







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

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







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

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







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

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
 
Guardian2003







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

No I just recounted the fields and they add up fine, hmm...
 
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.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©