Search found 761 matches

by Flaming_cows
Sat Feb 04, 2006 7:56 pm
Forum: [2.0.x] MOD Writers Discussion
Topic: Dynamic filtering of topics based on critieria.
Replies: 2
Views: 368

Searching is trhe usual way to find stuff like that (e.g. search for 'USA texas' to get all related posts). It might be easiest to just stick a search box in your forum header. If you need to implement your own version, you can just create your own page by copying and then modifying the search code ...
by Flaming_cows
Thu Feb 02, 2006 10:18 pm
Forum: [2.0.x] MOD Writers Discussion
Topic: wild cards
Replies: 13
Views: 1334

Five minutes of effort and I cleaned up the code and got it working as expected, with one minimal bugfix ( preg_quote() -ing the hostname). And it only involves one very simple regex. <?php function is_allowed_host($link_url, $allowed_hosts) { $url_info = parse_url($link_url); $link_host = $url_info...
by Flaming_cows
Thu Feb 02, 2006 7:40 pm
Forum: [2.0.x] MOD Writers Discussion
Topic: wild cards
Replies: 13
Views: 1334

Yes, that's what I just said in my previous post.
by Flaming_cows
Wed Feb 01, 2006 9:02 pm
Forum: [2.0.x] MOD Writers Discussion
Topic: wild cards
Replies: 13
Views: 1334

Look, I don't know how to make this any simpler: function is_allowed_host($link_url, $allowed_hosts) { ... } Use that function, the first argument is the full URL of the link being checked, and the second argument is an array containing hostnames that can have '*'s in them for wildcard matches. I ca...
by Flaming_cows
Wed Feb 01, 2006 8:58 pm
Forum: [2.0.x] MOD Writers Discussion
Topic: Listing topics on the home page - simplifying phpbb
Replies: 2
Views: 455

Heh, old MOD Request topic that I answered:
http://www.phpbb.com/phpBB/viewtopic.php?t=182382
by Flaming_cows
Tue Jan 31, 2006 7:47 pm
Forum: [2.0.x] MOD Writers Discussion
Topic: wild cards
Replies: 13
Views: 1334

This is the part that does the magic: foreach ( $allowed_hosts as $host ) { $host = '|'.str_replace(array('*','|'),array('.*?','\|'),$host).'|i'; if ( preg_match($host,$link_host) ) return TRUE; } If you don't know enough PHP to figure out how to use that, you need to brush up before asking further.
by Flaming_cows
Mon Jan 30, 2006 9:37 pm
Forum: [2.0.x] MOD Writers Discussion
Topic: Tip for searching and replacing...
Replies: 6
Views: 1152

There is also an online regex testing tool if you prefer that.
by Flaming_cows
Mon Jan 30, 2006 8:52 pm
Forum: [2.0.x] MOD Writers Discussion
Topic: link with preserved session id in header
Replies: 5
Views: 720

That all seems correct at a glance, I don't have the source handy for comapring exact lines.
by Flaming_cows
Mon Jan 30, 2006 8:34 pm
Forum: [2.0.x] MOD Writers Discussion
Topic: link with preserved session id in header
Replies: 5
Views: 720

You need to include the template variable assignment in an assign_var(s) call. Usually there is one big one for each section of the page that you can stick it in (it does need to be in the right area to get in the correct TPL parsing). You would need to add the line: 'EXT_LINK' => $ext_link, // Note...
by Flaming_cows
Mon Jan 30, 2006 8:04 pm
Forum: [2.0.x] MOD Writers Discussion
Topic: wild cards
Replies: 13
Views: 1334

You can do something like: function is_allowed_host($link_url, $allowed_hosts) { list(,$link_host) = parse_url($link_url); foreach ( $allowed_hosts as $host ) { $host = '|'.str_replace(array('*','|'),array('.*?','\|'),$host).'|i'; if ( preg_match($host,$link_host) ) return TRUE; } } I assume you can...
by Flaming_cows
Sat Jan 28, 2006 3:19 am
Forum: General Discussion
Topic: Your Favorite MultiClient IM?
Replies: 10
Views: 1765

I use Gaim because it's easy to get, free, and works on my *nix and win32 boxes.
by Flaming_cows
Sat Jan 28, 2006 1:31 am
Forum: [2.0.x] MOD Writers Discussion
Topic: Edits/Updates/Removal checks?
Replies: 4
Views: 640

Emulate a diff by splitting on line endings and highlight any lines that don't match between the two (check the history/comparisons of a wikipedia article or pastebin for an example).
by Flaming_cows
Sat Jan 28, 2006 12:02 am
Forum: [2.0.x] MOD Writers Discussion
Topic: Tip for searching and replacing...
Replies: 6
Views: 1152

Regex is one of the greatest creations ever, I love finding a reason to use it in a project. It's especially interesting/fun to hear new problems and try to solve them with regex, like the removing nested quotes regex I came up with last night (for someone in #regex on FreeNode): $str = preg_replace...
by Flaming_cows
Fri Jan 27, 2006 11:11 pm
Forum: [2.0.x] MOD Writers Discussion
Topic: Auto update
Replies: 5
Views: 744

The functions all meet the requirements for minimum version compatability, but you really need to clean up that code. I mean clean it up a lot.
by Flaming_cows
Fri Jan 27, 2006 5:14 pm
Forum: [2.0.x] MOD Writers Discussion
Topic: Auto update
Replies: 5
Views: 744

Go to advanced search