Jump to content

mattvit

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Everything posted by mattvit

  1. Thankyou, that worked perfectly! Really appreciate it! Haha and I know - I thought, "there's gotta be a CSS whizz here somewhere..!"
  2. I know I'm pushing it here, haha, but I was hoping for CSS help! I hate to say it, but I copied this CSS from here: http://www.red-team-design.com/feature-table-design-with-css3 I did this partly because I am colorblind, partly because I know little CSS. So the problem is, this CSS seems to cause the table to stretch/spread across the entire length of the page. (Well, across the content area, which is 900px, but that's irrelevant). Here's the code: .features-table { width: 100%; margin: 0 auto; border-collapse: separate; border-spacing: 0; text-shadow: 0 1px 0 #fff; color: #2a2a2a; background: #fafafa; background-image: -moz-linear-gradient(top, #fff, #eaeaea, #fff); /* Firefox 3.6 */ background-image: -webkit-gradient(linear,center bottom,center top,from(#fff),color-stop(0.5, #eaeaea),to(#fff)); } .features-table td { height: 50px; line-height: 50px; padding: 0 20px; border-bottom: 1px solid #cdcdcd; box-shadow: 0 1px 0 white; -moz-box-shadow: 0 1px 0 white; -webkit-box-shadow: 0 1px 0 white; white-space: nowrap; text-align: center; } /*Body*/ .features-table tbody td { text-align: center; font: normal 12px Verdana, Arial, Helvetica; width: 150px; } .features-table tbody td:first-child { width: auto; text-align: left; } .features-table td:nth-child(2) { background: #efefef; background: rgba(144,144,144,0.15); border-right: 1px solid white; } .features-table td:nth-child(3) { background: #e7f3d4; background: rgba(184,243,85,0.3); } /*Header*/ .features-table thead td { font: bold 1.3em 'trebuchet MS', 'Lucida Sans', Arial; -moz-border-radius-topright: 10px; -moz-border-radius-topleft: 10px; border-top-right-radius: 10px; border-top-left-radius: 10px; border-top: 1px solid #eaeaea; } .features-table thead td:first-child { border-top: none; } /*Footer*/ .features-table tfoot td { font: bold 1.4em Georgia; -moz-border-radius-bottomright: 10px; -moz-border-radius-bottomleft: 10px; border-bottom-right-radius: 10px; border-bottom-left-radius: 10px; border-bottom: 1px solid #dadada; } .features-table tfoot td:first-child { border-bottom: none; } I'd like to be able to control the table width with the table tag, ie <table class="features-table" width=200>, but it won't allow me. Thanks, I know this is a PHP forum but I thought someone may still be able to help edit: I have tried changing things around, mainly guesswork, and tried looking up some CSS (not much) so I haven't just copied and pasted the code straight to here!! )
  3. Perfect, thank you very much. You're absolutely correct, I'm doing this the way-too-hard-way. All I needed to do, was add a field / column on the referred member's details which says how much they've earned the referrer. Thanks for taking the time to read through my gibberish!
  4. Final post! Just to give a strong idea of what I'm trying to do... Here's a snippet which I know won't work but gives myself the pseudo-framework to work on. while($row = mysql_fetch_array($result)) { $member_id = $row['member_id']; $newcredits = $row['earned']; $membercredits[$member_id]] = $membercredits[$member_id]] + $newcredits; } So some more questions - first, how do I make that work, and second, I'll need the variables $member_id and the total credits now associated with that, after going through and summarizing all credits earned. p.s. I just realised that it might be easier to have a field in the Members table which gives the total earnings the member has given the referrer. Would this be the best solution? The script is not currently in public use so it wouldn't be a problem...
  5. edit: Ignore the above - that makes it too confusing. I can do everything except what follows. Any help would be great. Still can't figure out how to do this one. I'm guessing I'd need dynamic arrays or something. Here's a pseudo script of how I'd want to do it, could anyone give the array translation of this pseudo?? Thanks. from EVENTS: get member_id and newcredit amount member_id = [1], totalcredit = totalcredit + newcredit from EVENTS: get member_id and newcredit amount have we got the member_id already? then totalcredit(for that member_id) = totalcredit + newcredit if this is a new member_id, then member_id = [2], totalcredit = totalcredit + newcredit from EVENTS: get member_id and newcredit amount have we got the member_id already? then totalcredit(for that member_id) = totalcredit + newcredit if this is a new member_id, then member_id = [3], totalcredit = totalcredit + newcredit and so on, etc How would I do this? Specifically, how would I set an array which stores the unqiue member_id and his relevant total credits, adding to the credits each time there's an occurrence of his member_id? Urgh this is giving me a headache!!
  6. Hi all, I'll try to make this as succinct and simple as possible. Thanks in advance for reading / helping, I do always appreciate it greatly. I have two tables (edit: in the mysql database) - one has member details and their total credits. The other is an 'events' table which gives a more detailed history of how they gained those credits - including whether it was from a referral. Basically, I'd like to make an output table so that a referrer can know how much each person he/she referred is earning them - the referrer gets a 5% cut of everything the referred is earning. Events look like this in the database: member id of who the event most relates to, event description for aesthetic output (irrelevant here), event type (referral earning), earning amount during that instance (ie, a small amount). Ideally the table will only show two variables. The first name of the member based on member_id, and the total they have earned. Jim's Referrals Table: Sally | 5 credits Matt | 4 credits The columns relevant are: TABLE MEMBERS: - member_id - totalcredits TABLE EVENTS: - member_id - eventtype (ie, referral) - amount (ie, amount earned on that event by referrer). I'm not asking for you to write the whole thing for me!!! That'd be lazy of me. I would say I'm leaving 'beginner' status when it comes to PHP. One of the few things I STILL have not picked up on how to do well is arrays, which are needed here I think. Could anyone give me some kind of pseudo-script on how they would do this? Then I can write it myself and post back if I have troubles with it. A bit of a pointer on the array (if you suggest one) would be fantastic, too. Again thank you in advance!!! Please ask if you need me to clarify any part of this (or all of it..!). edit: just realised I'll need another column in the events mysql table which indicates who the referred person is, because currently when the referrer earns 5%, it only says who it is in the aesthetic eventdescription column. Given that I add this column, what would you recommend to do what I need to do? (that is, create a table, each row contains the name of the referred person and the total earnings they've contributed to the referrer).
  7. Thanks a bunch, voip03!
  8. Hi all. Was hoping to open up a discussion on what the best option in this scenario is. Is it better to unset all session variables individually when a user logs out, or, destroy them all entirely? The latter would use fewer lines of code and would ensure no sessions are left behind (though that comes down to 'being on top of your code' or knowing the variables you've set). I'm a beginner to average PHP programmer. edit: I did a bit more reading on setting, unsetting and destroying variables. So I'll rephrase my question: What's the point of unsettng session variables upon logout if you receive a new session ID upon login?
  9. Hey all, I take back my comments and apologise. I was doing a 24-hour all-nighter programming session and was starting to get the '-I'm-Tired-So-I'm-Angry-At-Anything' that I hope others get too..!! (edit: I hope others get it too because otherwise I just look like an angry internet troll! I'm not.. ) Your comment re: 5 years and 1 spam post really impressed me. I guess I just wasn't used to this system. Does the verification go away eventually?? ie once someone is an established member with x posts or x time here?
  10. Ah ha! Found a question on stackoverflow which suggested the following. For SEO purposes (as there aren't many relevant results in Google) I'm making another post rather than editing. Here you go, world: $tweeturl = 'www.phpfreaks.com'; $tweetmsg = rawurlencode('CONTENT HERE'.$tweeturl.' #HASHTAG'); Thanks for your help anyway, MasterAce14! p.s. I don't know if it's just for newbies but this is one of the most spam-strict forums I've ever come across. The verification questions are extremely frustrating. I'm only 21 and couldn't care less about the Beatles (sorry!) so I had difficulty signing up initially... Pretty frustrating stuff. Won't be coming back here. (though I'm sure the members here are great )
  11. It worked! But sadly the little hash/pound symbol didn't make it through the URL into Twitter. $tweetmsg = "content here ".$tweeturl." &#35firsttag &#35secondtag"; Any ideas? Would using a HTML entity for the spacing help? ... maybe I should try that... update: The entity spacing didn't work. I'm stumped. Is there some way for the URL to decode the HTML entity, rather than the web server??
  12. Oooh thank you! I didn't think of that. I'll give it a shot now!
  13. Hey everyone, thank you for taking the time to read this. So I'm re-inventing the wheel..! Sort of. I thought it'd be a quick job to do, but it appears not to be. Basically, I just want to have a hash tag # in a variable. Is this possible? Ie, $twitter_msg = "I just was reading mattvits website, website.com #coolwebsites #awesomewebmasters" Is it possible to pass the hash symbol in a PHP variable? If so, how? I tried \#, didn't work. Again, thanks in advance!!
×
×
  • 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.