Jump to content

Matpatnik

Members
  • Posts

    227
  • Joined

  • Last visited

Posts posted by Matpatnik

  1. Hi guys, I came with a problem and can't find the solution. I looked on internet everywhere I could and here is the closest I found but still not right.

    The problem here is it cut the last part of the my longest table. The 2 tables doesn't have the same rows number but I need them all and I only need 1 category to be shown. 

    So I need the 2 tables be glued together side by side filtered by category ( both table share the same categories ) with no missing data (of that category)

    So far this is what I got. I tried to join but it keep duplicating rows so instead of getting 200 rows I get like 3k rows. I tried union too and no success. I'm out of inspiration right now.

    If you can point a right or better path it would be great. 

    Here's my query so far:

    SELECT t1.`id`, t1.c1, t1.`total`, t2.`id`, t2.c2, t2.`total`

    FROM (

    SELECT @i:=@i+1 AS rowId, `id`, `categories` as c1, `total` FROM extable17, (SELECT @i:=0) a ) AS t1,

    (SELECT @j:=@j+1 AS rowId, `id`, `categories` AS c2, `total` FROM extable18, (SELECT @j:=0) a ) AS t2

    WHERE t1.rowId = t2.rowId;

  2. Hi guys it's been forever I haven't touch code and I ended up with this situation.

    I have no problem to display the page with IE and FF.

     

    I have a div that contain embedded posts from a facebook page that should not exceed 500px by 500px and keep the left of the page. On the right there is an other div a little bit smaller that should float right but for some reason the facebook div seems to clear right only with chrome.

     

    I've been trying to wrap it, force my other div, and find a hack but no success.

    Since every attempt failed I went back to my original code.

     

    Your help is appreciated, thx!

     

    the address of the page is http://www.matpatnik.com/White-Spiders

     

    css:

    /****************** #desc Style ******************/#desc{	float: right;	width:450px;	max-width:450px;	display:block;}#desc>.innerBox>.contentBox{	height: 484px;}

    html:

    <div class="outerBox fb-page" data-href="https://www.facebook.com/WhiteSpiders"   data-width="500" data-height="500" data-small-header="true" data-adapt-container-width="true"   data-hide-cover="true" data-show-facepile="true" data-show-posts="true">    <div class="fb-xfbml-parse-ignore">      <blockquote cite="https://www.facebook.com/WhiteSpiders">        <a href="https://www.facebook.com/WhiteSpiders">WhiteSpiders</a>      </blockquote>    </div></div><div id="desc" class="outerBox"><div class="innerBox"><div class="contentBox">
  3. I prefer just hardcore writing code with NotePad. I feel that it is the only good and learnable experience to work on your coding. If you use DreamWeaver then you won't really remember how you did code because of the auto-completion. Where as if you did Notepad you could revise your code and you will get a more memorable experience for the next time that instance comes up.
    If it wasn't of Dreamweaver I probably wouldn't be as far as I am right now. When I first began with HTML in design mode, the program help me a lot to understand how a page should be structured and how to write the code properly. I've looked through the web to find tutorials but I had hard time to understand the whole thing (I learn faster by doing it than reading some explanation about a tag meaning...). Now that I know how to code most of my stuff (we are always learning), I'm always in code mode using the auto-completion to go a little bit faster, text coloration and indent to spot my statement, variables and debug quicker.
    Shhhhhhh!!! someone might hear you! :)
    I'm still using my old MX 2004 and not too impress by the newest one except for the psd support :) unfortunately
  4. Because there are 5 characters that you no longer want: /, ., p, h, and p and rather than starting at position 0 for the substring, you are starting at position 1.You can think of it like this:The length of ".php" = 4.The length of "/apage" = 6If you start at 1, then the length of the substring that you want is 1 less than it's current length (6). So, you subtract 4 for the ".php" and another 1 for the beginning "/".I hope that helped!
    Sorry I didn't explain my self correctlyWhat I meant by 5 is I had to delete 5 character at the end of $_SERVER['PHP_SELF'] to delete the .php but I only see 4 character when I echo it!I didn't count the first slash because it was not in the $maxcount variable.Justsomeguy, at first I didn't use the superblobal as parameter in that function and it didn't work, then I decide to try it anyway to see the result and it was working (but I probably change few things at the same time). :)
  5. i tried to do something like this
    while($row = mysql_fetch_array($result))  {  echo <div id="news">"#".$row['storynum'] . "<br /> " . $row['headline']."<br />".$row['published']."<br />".$row['story']</div>;  echo "<br />";  }

    but it wouldn't work. what should i do instead.

    you forgot to escape the double quote on the first echo it should look like this:
    while($row = mysql_fetch_array($result)){echo "<div id=\"news\">#".$row['storynum'] . "<br /> " . $row['headline']."<br />".$row['published']."<br />".$row['story'] . "</div>";echo "<br />";}

    and <div> tags need to be in between double quote too

  6. I just created this function and I want to know if there is a better way of doing it

    /* erase the / and .php from /apage.php */function page_name($_SERVER) {	global $name;	$maxcount = strlen($_SERVER['PHP_SELF']) - 5; // I have no idea why 5 there is only 4 character to me, 4 show the dot	$name = substr($_SERVER['PHP_SELF'], 1, $maxcount);	return $name;}

    and then I just call the page_name function and echo the $name.Thank you

  7. What I thought I could use the function to make the text of the news shorter in an home page but the news contain BBcode in it so it won't be a good idea in this purpose. I will use my second idea to do that then.Thank you :)

  8. Hi guys,I just find out about the function: substr($VAR, 0, 100). It's a cool function for news but limited to plain text.My problem is that it can mess the code and/or the validation when using it with BBcode and I would like to know if there is a way to keep the text shortned and having a the code in good condition. I've looked on php.net and browsed on google and didn't find anything useful.If there is nothing I can do about it then I will just add a textarea in the news form for the brief presentation of the news.Thank you for your idea

  9. I've fixed the breaking line in between each list with this:

    $Text = preg_replace("`\[list\]\r\n(.+?)\[\/list\]`is", "<ul class=\"listbullet\">$1</ul>" ,$Text);	$Text = preg_replace("`\[list=1\]\r\n(.+?)\[\/list\]`is", "<ul class=\"listdecimal\">$1</ul>" ,$Text);	$Text = preg_replace("`\[list=i\]\r\n(.+?)\[\/list\]`is", "<ul class=\"listlowerroman\">$1</ul>" ,$Text);	$Text = preg_replace("`\[list=I\]\r\n(.+?)\[\/list\]`is", "<ul class=\"listupperroman\">$1</ul>" ,$Text);	$Text = preg_replace("`\[list=a\]\r\n(.+?)\[\/list\]`is", "<ul class=\"listloweralpha\">$1</ul>" ,$Text);	$Text = preg_replace("`\[list=A\]\r\n(.+?)\[\/list\]`is", "<ul class=\"listupperalpha\">$1</ul>" ,$Text);	$Text = preg_replace("`\[\*\](.+?)\[\/\*\]\r\n`", "<li>$1</li>" ,$Text);

    Now I have to figure why I got this error on the validation

    Line 121 column 26: document type does not allow element "ul" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag.<ul class="listlowerroman"><li>Text</li><li>Text</li><li>Text</li><li>Text</li><The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element. One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
    According to w3schools it look that I can use <ul> or <ol> with a class http://www.w3schools.com/tags/tag_ul.asp Anyone can give me an hint?Thank you
  10. I just comeback from vacation, and did a painful reading of my code and others, good thing the comment exist :) , I'm back into it nowXenon Design, I'm not sure to understand your code. I did a quick reading about regex and I come out with this. I did change this line $Text = str_replace("[*]", "<li>", $Text); for this $Text = preg_replace("`\[\*\](.+?)\[\/\*\]`", '<li>$1</li>' ,$Text); so this is fixed.

    This line:$Text = nl2br($Text);Replaces line breaks with <br> tags. In versions of PHP prior to 4.0.5, nl2br replaces with <br>, after that it replaces with <br />. So your version of PHP is fairly old, 4.0.5 is several years old now. It would be best to upgrade PHP to a current version, but if you can't do that then you can replace the nl2br line with this:
    My php version is fine, it juste because I was using a selective view source so the nl2br() was not able to show it properly... anyway I'm not totally sure about what I'm saying :) . But I know for sure that when I viewing the whole source from the page (not just a part) it showing it just fine.
    If you want to try to get around having line breaks at the end of <li> tags, then you can strip them before you do the replace. You would want to replace "<newline>[*]" with "[*]" and replace "<newline>[\list]" with "[\list]" before you replace the newlines. By <newline> I mean any of \r\n, \n, or \r. I don't want to give the code for that though, because the logic for creating a list isn't right in the first place. It does not add on the </li> tags, it should be doing that.
    what do you mean? can you show me an example plz
  11. sorry if it took me almost a month to reply to this post. I was fare from my computer for few weeks :) Do I have to change something in the header? because I still have the same error.I think it have something to do with

    function menu(allitems,thisitem,startstate){   callname= "gl"+thisitem;  divname="subglobal"+thisitem;    this.numberofmenuitems = 3;  this.caller = document.getElementById(callname);  this.thediv = document.getElementById(divname);  this.thediv.style.visibility = startstate;}

    and

    function closesubnav(event){  if ((event.clientY <48)||(event.clientY > 107)){	for (var i=1; i<= numofitems; i++){	  var shutdiv =eval('menuitem'+i+'.thediv');	  shutdiv.style.visibility='hidden';	}  }}

    I tried to change the this.numberofmenuitems = 3; to 6 because I thought it was related to the sub global but everything stop working.and I'm thinking too that line if ((event.clientY <48)||(event.clientY > 107)){ have something to do with the sub global. I just can't put my finger on it but I'm sure that I'm getting close. Well I hope :) thx for your time

  12. ok there is a lot of thing to cover herefirst of all you don't have a doctype (it's not obligatory but it's better to start using it) it tell the browser what type of html you are using.- you need to open a <html> tag.- when you open a tag you need to close it (there is some exception) so you didn't close the </center>, </body>, </html>.- don't use capital letters inside a html tag (it's a bad habit) you will understand more when learning xhtml.now you should take a look at the this tutorial: http://www.w3schools.com/html/default.asphere an exemple of what your code should look like:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gacattac</title></head><body><script type="text/javascript"><!--google_ad_client = "pub-9751449157894250";google_ad_width = 728;google_ad_height = 90;google_ad_format = "728x90_as";google_ad_type = "text_image";//2007-02-27: gacattacgoogle_ad_channel = "7732427496";//--></script><script type="text/javascript"  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script><br><br><b><h1>SITE COMING SOON</h1></b><br><br><b>affiliates</b><br><a href="http://www.html-master.piczo.com">html-master</a><br><a href="http://www.entertainmenttoday.multiply.com">entertainmenttoday</a><br><br><center>Want to get more hits on your site?<br>advertise on other sites using google adwords!</center><br><script type="text/javascript"><!--google_ad_client = "pub-9751449157894250";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as_rimg";google_cpa_choice = "CAAQnJT88AEaCMK4_ISyftj8KKSxynM";google_ad_channel = "8637012350";//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></center><script type="text/javascript" src="http://link.freewebs.com/JS/checkLogin.jsp"></script><script type="text/javascript" src="http://images.freewebs.com/JS/prototype.lite.js"></script><script type="text/javascript" src="http://images.freewebs.com/JS/moo.fx.js"></script><script type="text/javascript" src="http://images.freewebs.com/JS/jjax.js"></script><script type="text/javascript" src="http://images.freewebs.com/JS/fw.shoutbox.js"></script><script type="text/javascript" src="http://link.freewebs.com/Members/Comments/loadShoutBoxJS.jsp?shoutBoxOwnerID=23961391&listID=2715956&skinName=light&width=300&height=400"></script><!-- --><script type="text/javascript" src="/i.js"></script></body></html>

    * for the JavaScript you will need the advise of other peopleI hope that help you :)

  13. I did add the stripslashes() function and I find my mistake.I know what I was doing wrong, well I think, probably the breaking line was fine from the beginning. I'm using FF2 Web Developer add-on to have a quick look on the code instead of looking through the whole source and looking line by line where is the code... anyway by doing that the browser didn't look at the Doctype it just show the code where I highlight it so in this case it will show <br> as a breaking line. I just realize that :) does it make sense?

  14. hey thank you for the explanation but do I need to have the same amount of subglobal in each menu?because the way it is now the first menu have 6 subglobal, the second 3 subglobal and the third 2 subglobal.Or do I just delete this line: var menuitem7 = new menu(3,7,"hidden"); (because the maximum of subglobal is 6)

×
×
  • Create New...