-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
This thread is not meant to promote using frameworks instead of using core javascript for everything. That is just silly. Frameworks are not alternative languages, they are tools built on existing languages to make certain things easier. This thread is about using a framework for AJAX specifically.
-
There is no way to "force" an author to mark a topic as solved, because whether or not it is solved is arbitrary and completely up to the author. There is no way to write a script that can automatically decide whether or not the topic is solved. Nor can we "force" someone to do it by other means.... threatening something like warnings or a ban is unrealistic and IMO just stupid.
-
Yes, the firebug and also Web Developer addons are your two best friends, especially with client-side web development.
-
I assume you have an array you are looping through? And I also assume that this is only supposed to affect words that are completely capitalized? I think AyKay47 was on the right track, but this is a more efficient way of doing it. // example array $feed = array('AB','ABC','ABCD','AA','something','foo','bar'); foreach ($feed as $k => $v) { $feed[$k] = preg_replace("~^[A-Z][A-Z]+$~e",'ucfirst(strtolower($0))."__"', $feed[$k]); }
-
"Notify me of replies", what does it mean ?
.josh replied to colap's topic in PHPFreaks.com Website Feedback
To clarify, the "notify me of replies" checkbox at the bottom of the form in a thread/post does the same thing as the one you pointed out in profile settings, except on a local level. If you were to do it in your profile settings, it would apply to all topics you post in or start. If you don't want that, and want to just be notified of specific ones, then you should keep it disabled in your profile and use the checkbox option in the individual threads. -
"Notify me of replies", what does it mean ?
.josh replied to colap's topic in PHPFreaks.com Website Feedback
It emails you a notification email (to the email you provide for your account) whenever someone posts to your thread. -
It seems to me like the advantages of the rapid release cycle would play into the decision at least as much as the version number. I'm not sure how much the version number really means to people, that would be hard to determine concretely. well I get to look at web analytics reports and usability tests all the time, and while I admit I haven't seen anything directly related...in my experience, a lot of people really are that stupid. I think the main bitch I've heard about it though is it constantly breaks addons and shit.
-
This is in fact exactly (and officially) why they are doing it. It is nothing but a marketing campaign, because unfortunately, lots of people do just look at the version number and think FF is way behind. So expect rapid updates until they at least catch up to the other browser versions. Well, it's not exclusively superficial. It does have advantages over just increasing version number. They announced this as part of their new rapid release development cycle; they're expecting to reach FF7 before the end of the year. It's definitely a good thing.. would be even better if they adopted the chrome auto-updating mechanism. Yah...I mean they are releasing some updates each time, but that's the main reason, and we wouldn't be seeing it updated like this if it were not for that reason. And since that's not exactly a secret, I wish they would just cut to the chase and make the next release...jump directly up to 10 or whatever and get it over with.
-
here's my take...not really perfect but it's a good starter... <?php // example links $content = <<<EOF <a href='http://www.somedomain.com'>a</a> <a href='http://www.mydomain.com'>b</a> <a href='somepage.php'>c</a> <a id='blah' href='http://www.somedomain.com'>d</a> <a href='http://www.somedomain.com' id='blah'>e</a> <a href='http://www.mydomain.com' id='blah'>f</a> EOF; function checkDomain ($matches) { $url = parse_url(strtolower($matches[4])); $target = (!$url['host'] || ($url['host']=='www.mydomain.com')) ? "" : " target='_blank'"; unset($matches[0],$matches[3]); $matches = implode('',$matches); return "<a".$target.$matches.">"; } echo "<pre>".htmlspecialchars($content)."</pre>"; // before $content = preg_replace_callback('~<a([^>]*)(href\s?=\s?([\'"]))((??!\3).)*)(\3)([^>]*)>~i','checkDomain',$content); echo "<pre>".htmlspecialchars($content)."</pre>"; // after ?> Before: After: At least one improvement that can be made...this doesn't really account for if the target attribute already exists. So additional code could be written to check if it is there and then either overwrite it or let it be the overrider. Also, IMO this would probably be a lot easier to do client-side if you are using a framework like jQuery.
-
This is in fact exactly (and officially) why they are doing it. It is nothing but a marketing campaign, because unfortunately, lots of people do just look at the version number and think FF is way behind. So expect rapid updates until they at least catch up to the other browser versions.
-
Hello Miles, The first link you provided does not have the joomla stuff. Nor did you explain how to interact with the page and what it's supposed to be doing. Also FYI I did see in the source of this link the following: Not sure that's really relevant here, though it probably adversely affects being able to test the page... but regardless, page still isn't all that helpful to QA w/out the joomla stuff on it. Also, you said it's not spitting out any js errors...what are you looking at to see if there are js errors? I see the following error: You are attempting to look for an element with an id attribute of 'card_template' here: var cardTemplate = document.getElementById('card_template').value; However, when I look at the source of the page, I see nothing with that id. What I do see is the following: <select name="card_template" class="card_template" onchange="gamercardGenerator.update()"> You need to either add an id attrib there or target it a different way. I tried to upload the code from your 2nd link and test it, but there were too many errors to wade through to bother. Too much stuff on the page dependent on other stuff on your site that isn't being loaded for whatever reason. Maybe required stuff output server-side, relative links, etc... but I did happen to see the same error listed above. I'm afraid that's about all I can really do unless you can provide a link to a live page on your site, with your code and the joomla stuff on it.
-
For the most part, when I multi-quote, I usually start out with the full block of text I am quoting, and then break it up chunk by chunk. Or I'm quoting multiple people, in which case I can just click on each quote button. But there are times when I want to quote just part of something and it's buried within a whole lot of something else, and something like what you mention would indeed be convenient. Not sure how feasible that really is though... ideally it would have to not only capture the text, but the markup and styling behind all the pieces of what you select and then translate it back to the bbcode version..something I don't think the SMF software currently does at any point. I'm pretty sure the posts are stored in the DB as how you enter it in when posting (with bbcode) and then it gets parsed when displayed. IOW, there's code that goes one way, but not the other. And for the quote, it just pulls what is currently in the db. Which is easy enough when you're just pulling an entire entry by an id, but trying to figure out the correct bbcode wrapped around selected text (even individual parts of it)...
-
Associative arrays do have an order, but it is ordered internally...and I'm pretty sure internally they have numerical references...dunno why there is no native way to refer to it. If you are just trying to loop through them, then use a foreach loop as already suggested. But if you are wanting to target an individual one, like "show me the 3rd one in the list", you can make a function easy enough to simulate it: $array = array( 'a' => 'apple', 'b' => 'banana', 'c' => 'coconut' ); function getValueByNumber($array,$pos) { if ( ($pos < 0) || ($pos > (count($array)-1)) ) return false; $c = 0; reset($array); while ($c < $pos) { next($array); $c++; } return current($array); } // following the convention that numeric indexes start at 0... echo getValueByNumber($array,2); // output: coconut
-
Also, i see a list of functions...where are you actually calling it? Like gamercardGenerator...where are you acftually calling that?
-
Well my guess is somewhere along the line joomla is altering id attribs or something, but only being executed based on doctype..if its not there, it doesnt do nothin' sort of thing. And you'd probably have to look at live dom not just viewsource or saved source. By itself, i don't really see anything wrong with it. I'm not sure there's anything we can do more to help without seeing it in action, interacting with the rest of the stuff on the page
-
what doctype are you using and how are you trying to use it?
-
change $umps[] = array(); to $umps = array(); You are initializing an array as first element of an implied array ($umps), instead of just initializing $umps itself as an array.
-
$expr = '~(?:http://)?(?:www\.)?youtube\.com/watch(??:(?!v=|\s).)*)v=([-a-z0-9_]+)[^ ]*~i';
-
that will also remove the http:// and www. but that stuff after the link... " <br><br>testing youtube videos ^^"" you're gonna have to explain what all that is about...no real easy way to get rid of arbitrary text like that...
-
ah okay $expr = '~(?:http://)?(?:www\.)?youtube\.com/watch(??:(?!v=|\s).)*)v=([-a-z0-9_]+)~i';
-
$expr = '~youtube\.com/watch(??:(?!v=|\s).)*)v=([-a-z0-9_]+)~i';
-
that's because 'm' is for month.
-
when you use mysql_query(), that returns a result source. You must then get the data out of the result source using mysql_result, mysql_fetch_assoc, mysql_fetch_row, or similar (follow the links). For example, if one of your database columns is called "foo" and you want $col1 to be assigned "#CCC" if the value of the "foo" column is "bar", and "#fff" if not, you would do something like this: $post = "SELECT * FROM dbKarma"; $post_query = mysql_query($post); // loop through each row of the returned query results.. while ($row = mysql_fetch_assoc($post_query)) { // if column 'foo' equals 'bar'... if ($row['foo'] == 'bar') { $col1 = "#CCC"; } else { $col1 = "#fff"; } }
-
How about you show example of actual content you are trying to make changes to (what is actually in $string), including a "before" and "after".