Link to Mod Share Mod Share

  Users Browse Upload Forums Log in

Mod Share Forums

Welcome to the Mod Share forums.

You are not logged in.

#1 2012-06-12 13:35:38

chanmanpartyman
Mod Share-er
Registered: 2012-04-14
Posts: 25

Uploading then making a new directory

It is done on modshare with project id's.
I was wandering how to automatically create a new directory when something is made.


sigm.fw.png

Offline

#2 2012-06-12 17:17:01

jacob
Mod Share Team (now jvvg)
From: Eastern United States
Registered: 2011-12-25
Posts: 375
Website

Re: Uploading then making a new directory

You mean in PHP? Just use mkdir()


zwgbewe1gbewzygbewizgbew
Fear me, all powerful forum moderator! tongue

Offline

#3 2012-06-12 17:48:56

chanmanpartyman
Mod Share-er
Registered: 2012-04-14
Posts: 25

Re: Uploading then making a new directory

Okay, thanks. I don't know much PHP, I'm learning, but one of the ways I learn is by observing. You can't observe PHP if it is done beforehand and doesn't show up tongue


sigm.fw.png

Offline

#4 2012-06-12 17:55:45

jacob
Mod Share Team (now jvvg)
From: Eastern United States
Registered: 2011-12-25
Posts: 375
Website

Re: Uploading then making a new directory

chanmanpartyman wrote:

Okay, thanks. I don't know much PHP, I'm learning, but one of the ways I learn is by observing. You can't observe PHP if it is done beforehand and doesn't show up tongue

If you want, we can give you the source code for some pages on Mod Share (obscuring some code, such as how passwords are stored).


zwgbewe1gbewzygbewizgbew
Fear me, all powerful forum moderator! tongue

Offline

#5 2012-06-13 15:37:36

LS97
Mod Share Team
Registered: 2012-01-14
Posts: 218

Re: Uploading then making a new directory

jacob is right in that you have to use mkdir() in PHP to make a new directory, but that's not entirely what we did with projects.

We modified the HTACCESS code to add a RewriteRule that actually rewrites the pretty URLs /view/1234567890 into something more web-like, for example view.php?project=134567890

(Of course that's not the real URL... there's not even a file called view.php in the main directory big_smile)

After that, the page (view.php in the example) will use that GET variable to identify the details of the project from a database, and display the contents of that page. Pretty neat!

For more info google RewriteRule smile


LS97 - Mod Share Admin

Offline

#6 2012-06-23 22:10:02

chanmanpartyman
Mod Share-er
Registered: 2012-04-14
Posts: 25

Re: Uploading then making a new directory

jacob wrote:
chanmanpartyman wrote:

Okay, thanks. I don't know much PHP, I'm learning, but one of the ways I learn is by observing. You can't observe PHP if it is done beforehand and doesn't show up tongue

If you want, we can give you the source code for some pages on Mod Share (obscuring some code, such as how passwords are stored).

That would be great.


sigm.fw.png

Offline

#7 2012-06-23 23:58:32

jacob
Mod Share Team (now jvvg)
From: Eastern United States
Registered: 2011-12-25
Posts: 375
Website

Re: Uploading then making a new directory

chanmanpartyman wrote:
jacob wrote:
chanmanpartyman wrote:

Okay, thanks. I don't know much PHP, I'm learning, but one of the ways I learn is by observing. You can't observe PHP if it is done beforehand and doesn't show up tongue

If you want, we can give you the source code for some pages on Mod Share (obscuring some code, such as how passwords are stored).

That would be great.

Which page do you want the code of? I'll send you the link through your notifications.


zwgbewe1gbewzygbewizgbew
Fear me, all powerful forum moderator! tongue

Offline

#8 2012-06-24 11:54:18

chanmanpartyman
Mod Share-er
Registered: 2012-04-14
Posts: 25

Re: Uploading then making a new directory

jacob wrote:
chanmanpartyman wrote:
jacob wrote:
chanmanpartyman wrote:

Okay, thanks. I don't know much PHP, I'm learning, but one of the ways I learn is by observing. You can't observe PHP if it is done beforehand and doesn't show up tongue

If you want, we can give you the source code for some pages on Mod Share (obscuring some code, such as how passwords are stored).

That would be great.

Which page do you want the code of? I'll send you the link through your notifications.

Home page and Upload page please.
[offtopic]
Did you just add the edit post name feature?


sigm.fw.png

Offline

#9 2012-06-24 12:48:59

jacob
Mod Share Team (now jvvg)
From: Eastern United States
Registered: 2011-12-25
Posts: 375
Website

Re: Uploading then making a new directory

1. Ok, coming right up
2. Yes


zwgbewe1gbewzygbewizgbew
Fear me, all powerful forum moderator! tongue

Offline

Board footer

This is part of Mod Share v4.0