Jump to content

Lautarox

Members
  • Posts

    132
  • Joined

  • Last visited

    Never

Everything posted by Lautarox

  1. I'm using jquery with my script, I have this function and this variable. var page = 1; var opciones = $.parseJSON('[["cacona","caconudo","caca","weopo"],["cacona","caca","weopoweopo","caconudo"],["caca","weopo","cacona","caconudo"],["cacona","caca","caconudo","weopoweopo"],["caca","cacona","caconudo","weopo"],["caca","cacona","caconudo","weopoweopo"],["cacona","weopo","caca","caconudo"],["caca","weopo","cacona","caconudo"],["caca","caconudo","weopo","cacona"],["cacona","weopo","caca","caconudo"]]'); var preguntas = new Array("¿Como me llamo?", "¿Donde vivo?", "¿En que barrio?", "¿En que barrio?", "¿En que barrio?", "¿En que barrio?", "¿En que barrio?", "¿En que barrio?", "¿En que barrio?", "¿En que barrio?"); function getActualContent() { if(page == 3) { iValue = 2; } else { iValue = 4; } for(i=0;i<iValue;i++) { actualValue = (i+(4*page)-4); $("#"+elementSelected[actualValue]).attr("checked", true); $("#preguntaText"+(i+1)).html("Pregunta "+(actualValue+1)+": "); $("#pregunta"+(i+1)+"Span").html(preguntas[actualValue]); for(j=0;j<4;j++) { $("#opcion"+(i+1)+"-"+(j+1)+"Span").html(opciones[actualValue][j]); } } } $("#back").click(function() { $("#mainTable").hide("slide", {direction: "right"}, 800, function() { if(page == 3) { $("#secTable1").show(); $("#secTable2").show(); } saveActualContent(); page = page-1; $("#pageSpan").html(page+"/3"); cleanChecked(); getActualContent(); getAnchor(); }); $("#mainTable").show("slide", {direction: "left"}, 800); }); If I loop all over opciones, it shows correctly each value of the array, also when I go to the next page it still works, but it strangly fails when going back, it shows in firebug: undefined opciones[actualValue] in the function getActualContent and stats looping back, don't know why. Thanks in advice
  2. I've fixed it using float: left; and clear: both;
  3. I'm having some trouble positioning divs trying to make this kind of header, If I make it work on my browser, in another screen resolutions it changes. Here's the screenshot I was using float left for the image and it fitted correctly, but on another browsers, the ads div was below the image. I've tryied doing it with tables, but I didn't get what I wanted. Any suggestions?
  4. I don't think creating an irregular shaped div will be possible, you could use Canvas to draw what you want into the browser https://developer.mozilla.org/en/drawing_graphics_with_canvas but I don't think you'll get a full suppor by all browsers. You could also use the google map's api.
  5. If I'm not mistaken, Excel files can be saved in a XML readable way, the user should save his file in that format and once he uploads it you can parse the file using the xml functions from php.
  6. Yes, it is possible, you have to store the transaction ID and then use it for authenticate the user.
  7. You could create a class to use as a struct.
  8. You can make an admin module for your application with new and unread comments fetched by post and also by date, the comments should have an accepted column on your database to know what to be shown on the comments page of each post. About the desing, you can use a checkbox to check the suitable comments and then a submit button to send which comment will be accepted and which will be deleted from the database.
  9. I'm building a facebook application, as it is intendeed to reach to a big ammount of users, I'm worried about the performance of it, I'm querying facebook to get user's friends and then I'm searching for each of them in a mysql database, what would you recommend me to do? Is it better to perfom separated querys looking for each user or should I make a query looking for all the users, something like, SELECT * FROM table WHERE id=id1 AND id=id2 ... Thanks in advance
  10. If you want a kind of pop up, you can use color http://colorpowered.com/colorbox/, a jquery plugin. .text(responseData.message) is placing the text shown when validating.
  11. Take a look at this class, http://www.phpclasses.org/package/3679-PHP-Communicate-with-a-serial-port.html
  12. Why is it inside a loop?
  13. I was using the xml_parse() function when I've noticed there are some "&" inside the xml tags, like this <> & </>, I was trying to use preg_replace on it, but I couldn't, I've used the pattern "/<(.*)>(.*)&(.*)</(.*)>/" and the replace string "<$1>$2and$3</$4>"; but it doesn't even print the "<>" . Any suggestions? Thanks in advance
  14. E-mail and password text boxes are larger than the div and the main text is a little too near to the right menu, try getting those things fixed, otherwise, nice design =P
  15. I've been reading some tutorials, but I can't figure out how to get the content from here: reg_match('#<td height="99%" colspan="3" class="mensajeBody">(.+?)</td>#', $content, $s_body); From: <td height="99%" colspan="3" class="mensajeBody"><P>Los que no presenten el TP de la semana 4 en el día de la fecha antes de las 22 hs. quedarán con el primer informe desaprobado.</P> <P>Saludos</P> </td> [code] The phpfreak's tutorial says that ([^<]+) and (.+?) would get anything inside.. And what about if I want to not match the <> and what's inside? Will something like this be ok? ([^<.*>]+)
  16. Yeah, thanks for your time, I'm going to take a better look to the tutorials, using () confuses me a lot..
  17. Lol, thanks, about the | metacharacter, is it ok used like this? preg_match_all('#<td height="1" valign="top">(.*)</td>|<<A href=#', $content, $s_asunto); I'm triying to get the content in the middle matching it if </td> or <<A href=# is found at the end. Regex is getting me a little confused
  18. I have this.. <td height="1" valign="top" nowrap>Recibido el:</td> <td height="1" valign="top">15 Mar 2005 21:14</td> </tr> <!-- INICIO DESTINATARIOS --> <tr> <td height="1" valign="top" nowrap>Para:</td> <td height="1" valign="top">Lavezzari Georgina <<A href='compose.php?nomUsr=glavezzari'>glavezzari</A>></td> </tr> <tr> <td height="1" valign="top" nowrap>Asunto:</td> <td height="1" valign="top">class 1</td> And using preg_match('#<td height="1" valign="top">(.*)</td>#', $content, $s_asunto); only prints: Array ( [0] => <td height="1" valign="top">15 Mar 2005 21:14</td> [1] => 15 Mar 2005 21:14 ) Why does it only finds one of them?
  19. I've changed the <td for /<\td ,the width like this, width=\"81\/%\ and the href like this <A href='compose\/.php\/?nomUsr , is that ok? how could I create a clear delimiter?
  20. I'll take a look at it, thanks!
  21. It's the only option I have.. I need that unique part of the code, how could I escape those characters?
  22. Well.. I did something like this and it didn't work <? preg_match("<td width=\"6%\" height=\"1\" valign=\"top\" nowrap >De:</td><td width=\"81%\" height=\"1\" valign=\"top\" >"\s>([^<])*" <<A href='compose.php?nomUsr", $content, $s_de); ?> I'm using the hole string because there are lots of HTML tags around the content
  23. In fact it's a long string, I'm using curl to retrieve some info from a page <td width="6%" height="1" valign="top" nowrap >De:</td><td width="81%" height="1" valign="top" >" Here is the text " <<A href=\'compose.php?nomUsr" It's anything where "Here is the text" is
  24. I want to extract phrases from a text, something like: "The bird was flying when the nest felt" -> extract flying that is between "The bird was" and "when the nest felt" How could I do it using preg_match? Thanks!
  25. Well.. I missed about the doctype, which would be the correct one?
×
×
  • 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.