Jump to content

b_hole

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

b_hole's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Funny you say that, because Firefox render it OK, the image is above the object. Anything you can think of?
  2. Hello, I have a simple code that show a short media player movie, using object and param. My problem is that I have images thumbnails, and when you click on it, a larger image shows, with a big z-index. But the media player object (even with 1 or -1 for z-index) keeps being on top of this image. What am I missing here? * I'm sorry, but I can't write here some code, I hope maybe tomorrow. Thanks alot :)
  3. That's nice, thanks shoz [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /] Do you have an idea how to deal situations when there is no </p><p> at the last li? What I'm doing is adding <p> at the beginning of the text and </p> at the end of the text, replacing every new line with </p><p> and then replacing [mylist] with <ul>, just like you suggested. The problem is that I can't tell for sure that there is new line at the end of the last li. This is OK: [code]some text... [mylist]line one line two line three [/mylist][/code] But this isn't: [code]some text... [mylist]line one line two line three[/mylist][/code] Thanks alot!
  4. I guess I'm lost here. Everything I tried didn't worked, and I can't find anything in www.php.net. I have wildteen88's code, but I can't think of a way to replace a specific text inside the ul (</p>\r<p>), and still leave everything eles as-is. Can someone point me to the solution?
  5. Any idea? [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /]
  6. [!--quoteo(post=373763:date=May 14 2006, 11:13 AM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ May 14 2006, 11:13 AM) [snapback]373763[/snapback][/div][div class=\'quotemain\'][!--quotec--] Change your code with this: [code]$_str=preg_replace("#\[mylist\](.*?)\[/mylist\]#is", "<ul>\\1</ul>", $_str);[/code] Now the PCRE engine will treat any instace of [ or ] as-is as. [ and ] have a special meaning and so you need to tell the PCRE engine to treat those characters as-is. Also note that that added teo characters after the last # in your regualar expressins. This tells the PCRE engine to ingore newline characters and to be case-insensitive too. [/quote] My mistake, of course I'm using \ before [. Anyway, case-sensitivity is not important at the moment, and I definitely don't want to ignore new-lines. Is it possible to change [b]</p>\r<p>[/b] inside every [mylist]?
  7. I'm trying to find a way to replace any [b][mylist][/mylist][/b] with [b]<ul></ul>[/b]. That not a problem. I use preg_replace like this: [code]$_str=preg_replace("#[mylist](.*?)[/mylist]#", "<ul>\\1</ul>", $_str);[/code] But I can't find a way to replace all the sub-strings [b]</p>\r<p>[/b] inside the replaced [mylist] with [b]</li>\r<li>[/b]. Can I do it with one preg_replace command?
  8. How can I show trackbacks to posts in my site? I guess I need to use HTTP_REFERER somehow, but how?
  9. [!--quoteo(post=350372:date=Feb 28 2006, 04:19 PM:name=hitman6003)--][div class=\'quotetop\']QUOTE(hitman6003 @ Feb 28 2006, 04:19 PM) [snapback]350372[/snapback][/div][div class=\'quotemain\'][!--quotec--] How are you storing the responses for the nonregistered voters? Is each response a db entry (meaning lots of db entries), or does each response have a line, and a field on that line (hits) indicated how many times it's been answered (meaning one line for each reponse, with the responses counted in that line)? [/quote] For nonregistered votes I have on one line for each answer, with "hits" to indicate how many times it has been answer. I don't have a problem showing the nonregistered vote - that easy. My problem is just with registered vote. [!--quoteo(post=350376:date=Feb 28 2006, 04:24 PM:name=markduce)--][div class=\'quotetop\']QUOTE(markduce @ Feb 28 2006, 04:24 PM) [snapback]350376[/snapback][/div][div class=\'quotemain\'][!--quotec--]Hi, I think I see what you mean, but post back if I am incorrect. You could use the mysql_num_rows function to count how many votes you have. $result=mysql_query("SELECT * FROM poll_answers WHERE question_id='$qid"); $number1=mysql_num_rows($result); $result2=mysql_query("SELECT * FROM members_poll_answers WHERE question_id='$qid"); $number2=mysql_num_rows($result2); $total=$number1+$number2; Is that what you mean? [/quote] You don't understand how my members_poll_answers table works: for each regostered vote I have a different line, that way I can make sure every registered user votes only once for each poll.
  10. I have 3 mysql tables dealing with polls: [u]poll_questions[/u]: id, question, status (status is int, where 0 is future poll, 1 is current poll and 2 is past poll that can't vote for anymore), [u]poll_answers[/u] (for counting non-register voters): id, question_id, answer, hits [u]members_poll_answers[/u] (for counting register voters): question_id, answer_id, member_id. Each poll has different number of answers. My problem is to calculate how many registers-users vote for each of the answers in the current poll (status is 1). I want to avoid as many DB connections as I can, but I can't think of a better way than: -select id from poll_questions where status=1 (lets call the result $qid) -select id from poll_answers where question_id=$qid (let say X is the number of relevant answers we found) -X times selecting the count of votes in members_poll_answers table (each time for different answer). That means a total of X+2 connecting to DB(!). Can someone help me here to do the same thing just "smarter"?
×
×
  • 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.