PHP Help (I'm Offering!)

Discussion in 'Scripts, 3rd Party Apps, and Programming' started by chris218, Jul 5, 2006.

  1. chris218

    chris218 New Member

    Messages:
    130
    Likes Received:
    0
    Trophy Points:
    0
    I'm offering PHP help.

    I am pretty "fluent" in php, and have specialised knowledge in certain php software, for instance phpbb.

    If you need a bit of help, PM me, or reply to this topic.

    Thanks

    Chris
     
  2. Chris Z

    Chris Z Active Member

    Messages:
    5,602
    Likes Received:
    0
    Trophy Points:
    36
    ok i was trying to create a speicalized download system that would check my bandwidth before letting the end user download the file and also generate a random code like validation kind of thing, idk if this is too confusing, but like it would send the generated random code to their e-mail
     
  3. chris218

    chris218 New Member

    Messages:
    130
    Likes Received:
    0
    Trophy Points:
    0
    the random generating code is possible, and is a 5 minute job. As for bandwidth thing... Does your host use cpanel to "moderate" your bandwidth? if not what does it use?
     
  4. chris218

    chris218 New Member

    Messages:
    130
    Likes Received:
    0
    Trophy Points:
    0
    Sorry, forgot to ask a few questions.

    1. Do you use a database? and what engine is it i.e mysql?
    2. Do you use some kind of connecting class to connect to it? or do you use the standard php functions? if you do use a class, please post it here, so I can customize the exaple aproriatly.
    3. Do you have php mail() avaible on your host?
    4. Do you have an existing download system?

    Thanks

    Chris
     
    Last edited: Jul 5, 2006
  5. chris218

    chris218 New Member

    Messages:
    130
    Likes Received:
    0
    Trophy Points:
    0
    checked out your site..

    I will take a look at this e107 download system, and try and modify it..

    As for the bandwidth, as seen as it is x10, it must be cpanel, I will try and find a way of pulling the bandwidth, from cpanel, I have never needed to before!
     
  6. chris218

    chris218 New Member

    Messages:
    130
    Likes Received:
    0
    Trophy Points:
    0
    had a look, but I would need quite a bit of time to examine this e107, and I don't really have the time.

    If You know a bit of php, and you understand the e107 system, you could try (I don't know the e107 system, and i don't have enough time to "learn" it)

    use rand() when the user loads the page, this is the code (out put of rand is a random number)

    stored in database with the requested download's ID, and the user's IP.

    uses mail() to email it.

    Then redirects to an input page, you input the code your emailed. POSTs to a script, SELECTs from the database, the code that the user inputs, checks that this user is indeed from that IP, then use the ID to find the download and download it..

    DELETE the row with that activation code once all done.

    For an example of any of the previous, just ask, I will give you one, but you might need to tweak it for e107.
     
  7. randomize

    randomize New Member

    Messages:
    674
    Likes Received:
    0
    Trophy Points:
    0
    Hey,

    I am a complete n00b at PHP and I know the probably one thing, and that is a PHP include!

    I was wondering, if you could tell me how to do the code for the following thing:

    index?=staff

    or along those lines! I think you understand what I mean!

    Anyway, help would be helpful!

    Oh and is there anyway to pull the latest forum posts from the forums, without using a CMS?? so its just a plain old PHP page, and it just pulls the newest posts?

    Your help is grately appreciated dude!

    Regards,
    Randomize

    P.S If it works, Ill send you some points!
     
  8. chris218

    chris218 New Member

    Messages:
    130
    Likes Received:
    0
    Trophy Points:
    0
    ok, well for page=staff on the end of an file..

    Code:
    if ( $_GET['page'] == 'staff' )
    {
    CODE HERE IF ITS HTML EITHER USE ECHO, OR DO THE BELLOW
    ?>
    HTML HERE
    <?php
    }
    
    The above saved in index.php (if index.php is the directory index) could then be accessed

    yoursite.com/blah/?page=staff

    or yoursite.com/blah/index.php?page=staff
    What forum software do you use?
     
    Last edited: Jul 5, 2006
  9. randomize

    randomize New Member

    Messages:
    674
    Likes Received:
    0
    Trophy Points:
    0
    Code:
    [/FONT]
    [FONT=Tahoma][/FONT] 
    [LEFT][SIZE=2]if ( $_GET['page'] == 'staff' )
    {
    CODE HERE IF ITS HTML EITHER USE ECHO, OR DO THE BELLOW
    ?>
    HTML HERE
    <?php
    }[/SIZE]
    [SIZE=2]
    [/SIZE]

    I don't completly understand that bit of code!

    Erm the forum software is phpBB[/LEFT]
     
  10. chris218

    chris218 New Member

    Messages:
    130
    Likes Received:
    0
    Trophy Points:
    0
    well its an if statement.

    between the curly brackets (if your web pages are html i.e you don't code in php) you would put

    ?>
    // your html
    <?php

    obvious it would have to be in a .php file
    what info would you like to be pulled. ie just topic title?
     
    Last edited: Jul 5, 2006
  11. randomize

    randomize New Member

    Messages:
    674
    Likes Received:
    0
    Trophy Points:
    0
    Yeah just the topic title!

    oh and perhaps how would I do it if I wanted to show which section its under as well!

    and as for the page code, I still aint understanding it, But I will find somewhere that will teach me!

    Regards,
    Randomize
     
  12. chris218

    chris218 New Member

    Messages:
    130
    Likes Received:
    0
    Trophy Points:
    0
    ok,

    http://www.phpbbhacks.com/download/2057 - topics anyway good MOD which will do what you want.

    ok put that code in whatever file you want as long as it is a php file

    the code for the page, page=staff goes beween the curly brackets - not that hard to understand

    <?php

    if ( $_GET['page'] == 'staff' )
    {
    MY STAFF PAGE HERE
    }

    ?>
     
  13. Chris Z

    Chris Z Active Member

    Messages:
    5,602
    Likes Received:
    0
    Trophy Points:
    36
    hey chris218, it seems your pretty good at php :D i started maybe a week or two ago but umm, as for what i have requested, it would most likely be a stand alone system, i don't want something already developed, i would like to have just a customized system made specifically for me, if that's not too much, if you have some sample code that would help or something haha thanks!
     
  14. chris218

    chris218 New Member

    Messages:
    130
    Likes Received:
    0
    Trophy Points:
    0
    so do you not want it "added in" to the e107 system?

    If not, thats no problem! I will sort some code out for you. As its not e107, I will stick a login system for the admin aswell, so you can easily add downloads.

    Chris
     
  15. Chris Z

    Chris Z Active Member

    Messages:
    5,602
    Likes Received:
    0
    Trophy Points:
    36
    thank you much! no i DO NOT want it installed into e107 or anything, just a customized standalone product THANK YOU SOOOO much!!
     
  16. chris218

    chris218 New Member

    Messages:
    130
    Likes Received:
    0
    Trophy Points:
    0
    Ok, its all done for you!

    Ok, the attached.

    1) unzip
    2) open includes/SystemComponent.php
    3) do as guided, filling in info for your site (the site address one, include the directory this download system is in.
    4) open includes/mail.php Set all the settings in their as instructed, again the site address, include the directory the download system is in.
    5) open header.php, right at the bottom, there is a link, where it says site here, put your main site address there (its a link back on all pages)
    6) open db.sql, where it says INSERT INTO dl_users, find md5('admin') and relplace admin with your cp password
    7) copy paste whole of db.sql, into something like phpmyadmin, and run it in the right database.
    8) upload folder (I recommend yoursite.com/downloads)
    9) the admin area is found at yoursite.com/downloads/admin

    Enjoy!!
     

    Attached Files:

  17. Chris Z

    Chris Z Active Member

    Messages:
    5,602
    Likes Received:
    0
    Trophy Points:
    36
    thank you so much chris218! that's great, i hope this works well, i'm sure it will but we all hope for the best
    THANK YOU THANK YOU THANK YOU!
     
  18. chris218

    chris218 New Member

    Messages:
    130
    Likes Received:
    0
    Trophy Points:
    0
    If you have any problems don't hesitate to ask me!
     
  19. Chris Z

    Chris Z Active Member

    Messages:
    5,602
    Likes Received:
    0
    Trophy Points:
    36
    ok will do, i have wanted one of these for a while...as far as the random code generator, is that implemented into the system? i would love to have that in there, just sorta as a verifier and also is the bandwidth checker in there?
     
  20. chris218

    chris218 New Member

    Messages:
    130
    Likes Received:
    0
    Trophy Points:
    0
    the bandwidth checker isn't in there, but the code validation is.

    I'm still trying to find out how to implement the bandwidth checker.
     

Share This Page