Go Back   Novahq.net Forum > phphq.Net > phphq.Net Forums

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-10-2012, 05:27 AM
Wolfseye is offline Wolfseye
Wolfseye's Avatar
Registered User

Join Date: Oct 2008
Posts: 10

Send a message via ICQ to Wolfseye Send a message via MSN to Wolfseye Send a message via Yahoo to Wolfseye
RollEyes A few questions about phUpload & phMapDB

Hi guys,

i realize the forum here seems not to be used anytime lately, but I hope to get a few informations.

About phUpload:

Is it possible to have some sort of notification (Email) when someone uploads something ? Would definately help knowing when someone uploaded something, instead of having to check daily for that. Only if something would be possible.

Also, I would prefer to use this as a way for people to upload something to me, not for using the files linked. Could that be removed that the links are not shown ?

Also would it be maybe possible to rename the "uploads" folder to something more random, just to be sure not to give people a target what to aim for when trying to exploit the script in some way.

I am not good with PHP stuff so I don't know for what I should check. Any help would be appreciated.

About phMapDB:

Installed it, added Gametpyes, the Games etc. and when I try to upload something I get an error that I didn't choose any Gametype, which I in fact did. So I don't understand it.

An error message is also shown at that time, which is like below.

Quote:
Warning: trim() expects parameter 1 to be string, array given in /www/htdocs/w00f6b94/web4/submit.php on line 108
Reply With Quote
  #2  
Old 09-10-2012, 06:56 AM
Wolfseye is offline Wolfseye
Wolfseye's Avatar
Registered User

Join Date: Oct 2008
Posts: 10

Send a message via ICQ to Wolfseye Send a message via MSN to Wolfseye Send a message via Yahoo to Wolfseye
And even more, is there a way to import a larger number of maps incl. screenshots via MySQL somehow, so I don't have to add manually hundreds of maps that I already have ? That would really help.

I would be thankful if you could help me please.

Wolfseye
Reply With Quote
  #3  
Old 09-10-2012, 09:13 AM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,919

Anything you want added or changed within phUploader I can do, but I charge a fee for custom modifications. Sometimes you can find what you need by searching posts in the forums here. You can change the upload folder name by modifying the config variables within the script.

As for phMapDB, you need to first add a game, then game types before you can upload any maps. I installed the script locally, and except for some things being a little out of date, it works perfectly.
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
  #4  
Old 09-10-2012, 09:22 AM
Wolfseye is offline Wolfseye
Wolfseye's Avatar
Registered User

Join Date: Oct 2008
Posts: 10

Send a message via ICQ to Wolfseye Send a message via MSN to Wolfseye Send a message via Yahoo to Wolfseye
Thanks for your reply.

I did add in fact Games and Types before I added a map. I am not that n00b. However, it didn't work and kept giving me this error. The only way to get rid of it, was to disable the requirement to add a Gametype. In that case I can only hope people will see the point in adding the Gametype to a map as well.

But now it actually worked, without that. Weird, but I am not good enough with PHP to find the issue or why it would happen to me.

Could you maybe give me an example about additional fields, like you have on Novahq.net ? The Submit form there has much more options. But I suppose that requires a good knowledge of PHP and MySQL, which are both not my good fortunes.

And the really most important for me would be, any way possible, to mass-add a couple hundred maps incl. Screenshot in just a few steps. Or it will take me a long time to add all those maps afterwards.

Anything you can help me with is appreciated.

Thank you.

Wolfseye
Reply With Quote
  #5  
Old 09-10-2012, 09:39 AM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,919

It's not really easy to describe to someone how to add fields if that person does not know any PHP.. I suggest reading some tutorials around the internet, there are some very good ones. The script is pretty old, and very basic so at least you dont have to work with a super complicated script.

Other than building a script, there isn't any way to automatically add maps to the database..

Sorry for the lack of good news...
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
  #6  
Old 09-12-2012, 02:36 AM
Wolfseye is offline Wolfseye
Wolfseye's Avatar
Registered User

Join Date: Oct 2008
Posts: 10

Send a message via ICQ to Wolfseye Send a message via MSN to Wolfseye Send a message via Yahoo to Wolfseye
Angry

Quote:
Originally Posted by Scott View Post
It's not really easy to describe to someone how to add fields if that person does not know any PHP.
Thats why I hoped you could help me. But I guess you are not interested in that.

Something else, would there be a way to not automatically rename the files to just a bunch of numbers when uploaded ? Because in case something goes fubar (example: DFBarracks - they have/had the same problem), you never find out again which file is which map. Because noone remembers which numbers represent what map. Is it somehow possible to keep the filenames what they are when uploaded ?

Thanks in advance.

Wolfseye
Reply With Quote
  #7  
Old 09-13-2012, 10:38 AM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,919

My workload right now jam packed, I don't have any extra time to teach someone how to add forms in PHP. There are a ton of tutorials online that describe how to do it much better than I can.

To keep the upload files name, in func.php in the mapdb, line 148, change this:
PHP Code:
$name=time().".".get_ext($_FILES[$file]['name']); 
to this:
PHP Code:
$name=$_FILES[$file]['name']; 
But to be honest, you should look for another download database. I wrote this script many years ago, before I had any real knowledge of how to properly secure a PHP script.
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
  #8  
Old 09-13-2012, 10:43 AM
Wolfseye is offline Wolfseye
Wolfseye's Avatar
Registered User

Join Date: Oct 2008
Posts: 10

Send a message via ICQ to Wolfseye Send a message via MSN to Wolfseye Send a message via Yahoo to Wolfseye
What are you saying ? You say this Script isn't secure ? You use it on your NovaHQ site. Why wouldnt it be secure if you use it yourself ? Or did you only secure it properly afterwards for your own site only ?

If its not secure really, you might add that to the description in your scripts downloads so people know. You cant expect anyone that uses a script for something like that, to be an expert in PHP. Thats not the point.

No offence intended btw.

Besides, there isnt really a good script i know of, thats designed to be for maps. Using a general download script was not what I had in mind. THats the good thing about your script, it is only ment for that.
Reply With Quote
  #9  
Old 09-13-2012, 10:54 AM
Wolfseye is offline Wolfseye
Wolfseye's Avatar
Registered User

Join Date: Oct 2008
Posts: 10

Send a message via ICQ to Wolfseye Send a message via MSN to Wolfseye Send a message via Yahoo to Wolfseye
Besides, as you said, there are many tutorials how to add fields in PHP and I am sure I would figure that out sooner or later. But I dont know how to combine that with MySQL then.
Reply With Quote
  #10  
Old 09-13-2012, 10:55 AM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,919

It's not the same script used here. And you're right, it should have a notice. I've added a notice to my website in the script description. There aren't gaping holes everywhere. Mostly it has to do with the mysql queries. Nothing is really validated and/or escaped before being inserted into the database... A little bit of time could probably fix this.

http://stackoverflow.com/questions/2...atabase-in-php
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
  #11  
Old 09-13-2012, 10:56 AM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,919

Here is a good tutorial:

http://www.phpeveryday.com/articles/...Data-P280.html
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
  #12  
Old 09-13-2012, 10:59 AM
Wolfseye is offline Wolfseye
Wolfseye's Avatar
Registered User

Join Date: Oct 2008
Posts: 10

Send a message via ICQ to Wolfseye Send a message via MSN to Wolfseye Send a message via Yahoo to Wolfseye
Hmm, the script looks the same, even if details are different. Ok, since I dont learn that much PHP and MySQL anytime soon most likely, I can't risk using that script if you say its not secured at all.

As you said, when you wrote that (and that sure took some knowledge) you didnt know about security. So now me even less capable of writing such a script, am the unlikely person to find whatever things aren't secure without knowing it all.

Too bad, was the only really specific map database script I could find. I suppose you dont share the other one you use on NovaHQ. So thats that.

Wolfseye

P.S: Thanks anyways. One less thing to do then it seems for me.
Reply With Quote
  #13  
Old 09-13-2012, 11:59 AM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,919

Alright, i've updated the script to fix most of the big security flaws and adjusted the script to keep the same files names. Download the attachment...
Attached Files
File Type: zip phMapDB.zip (50.2 KB, 9 views)
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:46 AM.




Powered by vBulletin®