Jump to content

Rantzien

Members
  • Posts

    17
  • Joined

  • Last visited

Posts posted by Rantzien

  1. No, you can either highlight a string of code or an entire file with highlight_string and highlight_file, but it only highlights PHP. You may be able to find PHP highlighters for other languages though if you bust a Goog.
    I figure I could, but if it's not built in I might as well do it myself :)
  2. So is this just a regexp question? Cause I hate to burst your bubble, but PHP already has a built-in PHP syntax highlighter:http://www.php.net/manual/en/function.highlight-string.php
    Oh my, I didn't know of that function. Thanks :)
    But, if you're just doing this for the learning value, then.. well, someone who knows more about regular expressions I'm sure will be right along to help you. If I was doing this, I probably wouldn't use regexp, I would probably just use some string parsing functions, maybe strtok, and keep track of things like opened and closed quotes, escaped quotes, etc myself.
    Well, I was partly doing this for training, but also to have it ready in case I needed it. And yeah, I recently scrapped the idea of using regular expressions in favour of parsing the string, although it's complex.There aren't any similar built-in functions for parsing other languages, are there?Thanks for your help!
  3. The short version is to give frame B a name attribute, for example:

    <frame src="url.html" name="frame_b" />

    And then, when you want a link to open in frame B when the link is in another frame, give the link the attribute target="frame_b":

    <a href="newurl.html" target="frame_b">Link text</a>

    If the link is in frame B and you want to force it to open in frame B as well, use the keyword _self for the target attribute:

    <a href="newurl.html" target="_self">Link text</a>

  4. First, try deleting the whitespace before the "affiliates" image:

    <td style="width:135px; height:31px;">	 <img src="layoutimages/djdtmb_03.jpg" style="width:135px; height:31px;" alt="affiliates" /></td>

    to:

    <td style="width:135px; height:31px;"><img src="layoutimages/djdtmb_03.jpg" style="width:135px; height:31px;" alt="affiliates" /></td>

    If that doesn't work, try adding "padding:0; margin:0;" to both that image and the corresponding "instructions" image.

  5. Hi ! How can I embed a scroll bar into a dropdown list. It appears automatically in a long list, but doesn't appear in a shorter one. I want it to still appear in it. Can someone give me the code for this ? Will be much appreciated. Thanks.
    Unfortunately, I don't think you can! Unless you make your whole own drop-down menu using Javascript or some such, but it seems like a lot of work for a small feature. Form elements in HTML are overall not very stylable.
  6. Well, this is not directly PHP, but I'm writing it in PHP, and it's also the language I'm currently trying to style. :) Anyway, I am trying to make a function to highlight code syntax properly (for example, giving strings one style, keywords another style, operators yet another style). Now, I hit an obstacle that I have trouble finding my way around.Consider this code:"foo ${"sometext"} bar" . "a little more text"The desired result is this:"foo ${"sometext"} bar" . "a little more text"That is, I want the string regex to match: "foo ${"sometext"} bar", "sometext" and "a little more text", which I then wrap with <span> tags to get the desired result.The variable within the string is already formatted, with this regex (pattern -> replacement):"/[$]{1,2}\{.*\}/sU" -> "<span class=\"default\">$0</span>"What I am confused about is this: I don't want the string regex to be a simple greedy one, like this: "/\".*\"/s" (since it would match everything from the first to the last double quote). But I don't want it to be a simple ungreedy one either, like this: "/\".*?\"/s" (since that would match "foo ${", "} bar" and "a little more text").I've tried doing: /".*(\{)?.*\1.*"/sU, but that makes the function fail. If you can help me, I'd be very grateful.

  7. I've now isolated it to being about background-color. If the link has a background-color on hover or active (likely on the other stages too), it gets displaced at the event in question. This still baffles me, but I will try to find a solution, and if I can't find one I'll work out something else. Thanks for the help I've gotten!Edit: The issue is now resolved. This page could tell me what was happening, and I could sort the rest out.

  8. The problem stretches further than the navigation bar, it's the div with id "center770" that covers the navigation bar. If you move it around 140px downwards, the links are "uncovered" and clickable, but then your content is too far down, right?Well, I looked a bit but to me the whole code looks very messy, I'm having a hard time cleaning it up to find the problem. There are, for example, two opening table tags but only one closing tag. I suggest cleaning it up thoroughly, maybe use pixels (px) instead of points (pt) when you're positioning absolutely and so on. Maybe you'll find the problem.

  9. The :visited declaration must come before the :hover declaration to be effective.I think there was something to help you remember the order of the link style declarations, like LoVe HAte (Link, Visited, Hover, Active).

  10. Thank you for that, it helped solve the line break problem. I do have Windows on the computer, and a Linux server, so I set FileZilla to transfer css files binary and it worked. This topic's problem wasn't magically fixed though :) If anyone knows or thinks anything about this, I'd appreciate your help.

  11. Huh, that's weird. When I open the css file from my computer to Notepad, it shows as usual, but when I open it from the server to Notepad, all line breaks show as square characters. I tried replacing the line breaks in Notepad, but it didn't change. Anyway, I'm not that experienced in the workings of character encodings, so if this may be what's causing the problem, what can be done to solve it?

  12. http://www.pontushorn.com/new/If you look at that page in Internet Explorer, and hover over a link, it shoves the last line of the previous paragraph and itself a small way to the left, or, if the link is in a paragraph, it displaces the whole paragraph the same way.When I first encountered this, I was completely baffled. I looked around for others having the same problem, and the only thing that seemed vaguely similar was something called the hasLayout problem, but I didn't understand all of it, and moreover, I couldn't find a solution. If I remove all the styling for link elements, the problem disappears.Does anyone have a solution to this problem, or at least a hint as to what the problem is?
×
×
  • Create New...