Jump to content

smartin1017

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

smartin1017's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi guys. Recently I stopped working for a company that I helped build a social network for. I had created classes and used those throughout the site. I now want to work on my own project but i cannot use what I created there. Now, I created a simple user class that allowed me to easily use the members info throughout the site. The only way I could think to do this was to name all the public variables within the class then pull the information from the DB for that user using their id and naming it to the public variables. End result, I would just have to do something like this to get the user info. $mem = new User($id) Then if i needed something, say their name I would use.. $mem->username I am being broad because I cannot use or reprint the code. It now belongs to them. I want to create the same thing for my project but I dont want to use something that is proprietary to them.My questions.. Can something like that be copywritten where there really isnt any other way to do it and If so what other way could I do it so I am not taking something I already wrote but doesnt belong to me. Its pretty confusing, any help would be greatly appreciated.
  2. By no means am I saying I am right with anything on this. Thats why I am asking. Its just weird to see this becoming a common thing. What do you suppose the benefits are to this?
  3. Hi guys, I have become a really good php programmer but cannot seem to find an answer for this. When I go to pages I always look at the URL to see how it handles things, I am talking about random sites not sites I build. I have noticed a lot that the pages are now in some sort of directory style. I still see a lot of the .php?id=12&name=bob ect.. but I am trying to figure out the index.php/sde/?out=true ect.. Is this still php? If not what is it? I have had clients ask about it and think it might be jsp? Thanks in advance for any advice..
  4. Hi Guys, I have a db that contains US zip codes, longitude and lattitude. I need to be able to find all zips that are within a certain radius of a chosen zip. I have tried a few different things but they all take up to a minute to find. I even tried creating a MySQL function to get the info but it is still taking more tehn 30 seconds to get results. There are over 41000 rows. Any help would be appreciated.
  5. Hi guys, I have a small block of php that is suppose to check to see if a debate is over and if it is it its suppose to update the winners wins fied and loses loss field. It seems to update the losers loss field but not the winnners. I went in and did a pure sql command in the phpadmin section and it updates the fiend but it doesnt work in this block of code. Please bare with me i am still learning so there are some redundant things in here. Also, I took everything out of this and just ran the first update in each else block to see if the wins filed would be updated and it wasnt. I also took the variables out and put in numbers and it still didnt update the winners wins field. Any help would be greatly appreciated. Heres the code.... $debateid=$_GET['debateid']; $resultxxx= mysql_query("SELECT * FROM debate WHERE thread='$debateid'"); $rowxxx = mysql_fetch_array($resultxxx); $timsss=time(); if ($timsss>$rowxxx['timeend'] && $rowxxx['status']==0) { $end="true"; $pmwid=$rowxxx['pmwid']; $chalid=$rowxxx['chalid']; $threadd=$rowxxx['thread']; if ($rowxxx['pmwvotes']>$rowxxx['chalvotes']) { $winner=$pmwid; $loser=$chalid; $resultw= mysql_query("SELECT * FROM users WHERE id='$winner'"); $roww = mysql_fetch_array($resultw); $winnerinc=$roww['wins']; $winnerinc++; $query4="UPDATE users SET wins='15' WHERE id='$winner'"; $resultl= mysql_query("SELECT * FROM users WHERE id='$loser'"); $rowl = mysql_fetch_array($resultl); $loserinc=$rowl['losses']; $loserinc++; $query5="UPDATE users SET losses='27' WHERE id='$loser'"; if(!mysql_query($query5)){die(mysql_error());} } elseif ($rowxxx['chalvotes']>$rowxxx['pmwvotes']) { $winner=$chalid; $loser=$pmwid; $resultw= mysql_query("SELECT * FROM users WHERE id='$winner'"); $roww = mysql_fetch_array($resultw); $winnerinc=$roww['wins']; $winnerinc++; $query4="UPDATE users SET wins='$winnerinc' WHERE id='$winner'"; $resultl= mysql_query("SELECT * FROM users WHERE id='$loser'"); $rowl = mysql_fetch_array($resultl); $loserinc=$rowl['losses']; $loserinc++; $query5="UPDATE users SET losses='$loserinc' WHERE id='$loser'"; if(!mysql_query($query5)){die(mysql_error());} } else { $winner="tie"; $resultw= mysql_query("SELECT * FROM users WHERE id='$winner'"); $roww = mysql_fetch_array($resultw); $tie=$roww['ties']; $tie++; $query4="UPDATE users SET ties='$tie' WHERE id='$winner'"; $resultl= mysql_query("SELECT * FROM users WHERE id='$loser'"); $rowl = mysql_fetch_array($resultl); $tiel=$rowl['ties']; $tiel++; $query5="UPDATE users SET ties='$tiel' WHERE id='$loser'"; if(!mysql_query($query5)){die(mysql_error());} } $query2="UPDATE debate SET status=1, winner=$winner WHERE thread='$threadd'"; if(!mysql_query($query2)){die(mysql_error());} }
  6. Hi guys, I am trying to create a countdown timer for a website. I enter the date into the DB using Timestamp, i want to add 7 days to that time and then show a timer on the page. I have come across a couple javascript timers now if i can find a way to put in the time formatted the way they need (ex. March 12, 2009 7:00_) that would be one way or if any of you know a better way i am all ears. I appreciate any help.
  7. Hi guys, I have a question about a shopping cart. I am about to try and build one but am hearing diffrent ways to do it and wanted to get some advice. Some are saying to use a cookie to store the ids of the items and just have the cookie last forever, some are saying to use a cookie to store a unique id generated from a database and have the DB store the items and some are saying to ask for an email address and password. What do you guys think, there are pros and cons to all of them in my mind. I would like to get your opinions. Thanks in advance.
  8. Hi Guys, I am trying to create a feed similar to Facebooks live feed. I used a combination of php and ajax and was able to get the general feed to work, although it isnt as seamless as I would like. Where I am running into a problem is the comments on the comment. I was able to put a loop and create a hidden div that opens when you click 'comment' but I cannot seem to get it to insert into the DB and then even more challanging populate the div with new info. Keep in mind the divs are created on the fly using an auto incrementing variable so i am having a tough time figuring out which div it it. This is a big challange and any help or advice would be greatly appreciated.
  9. Hey guys, I waswondering, I am finishing up a membership site in which i would like to give people the opportunity to put youtube videos and other embed coded things on a wall on their profiles. Am I leaving myself open to anything malicious. I see it all over the place and most of these social networks have this feature but i wanted to get some info on it. Thanks in advance.
  10. I would love it if you would send me the script. The question was how do they do it. I know it goes into a db and comes out but the instant part is what I was trying to figure out. Thanks
  11. Hi guys, I am trying to create a facebook like feed. I want people to be able to enter in comments almost like a chat room but comments can be commented on. I assume this is done with ajax where it is instant and no page loading but i am not sure. I figured I would start here because I have not had a time where I couldnt find the answer here yet. Thanks in advance.
  12. I looked into that function but for soeone coming to the site and filling in info they are not going to know to put in /n. Think of a social network, you fill in all these different textareas and they always show the paragraphs with the breaks. How do they do this, I am thinking they might use javascript with php. Any ideas?
  13. This is probably a real simple one for you guys, but I have a text area that saves a nio, the probalem is most people have more then a paragraph for there bio, how do I get the database to save the breaks and spaces between paragraphs and indents?
  14. So your saying to store all the messages in one field and seperate by semicolon, I am thinking different rows with a timestamp all attached to the same msg thread id, thus the two tables, but everytime I start I get stumped part way through. Keep in mind, one person can have multiple different messages at once with different users, the individual conversation will be in descending order going down the page.
  15. Thats is kind of what I was thinking but some things came to mind, in the query WHERE part you reference to, what if that same person is a from from a different message, this is wher I start getting confused. One user could have several messages going at once, so they could be a 'from' or a 'to', I was thinking of using two tables, one with a unique thread id, to and from, and the other with that id passed to it then an auto incrememnt msg_id and everything else you states, I still dont know if this will work. What are your thoughts?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.