the_tim
Forum Replies Created
-
Forum: Plugins
In reply to: [Social] [Plugin: Social] Url given to TwitterThis was bugging me as well. I was able to tweak the plugin to change this manually. It was easy enough. Just do a find and replace of all instances of wp_get_shortlink with get_permalink.
I found five that needed to be replaced:
Search "wp_get_shortlink" (5 hits in 3 files) \wp-content\plugins\social\lib\social\controller\aggregation.php (1 hits) Line 38: $url = wp_get_shortlink($post->ID); \wp-content\plugins\social\lib\social\service.php (2 hits) Line 386: $url = wp_get_shortlink($post->ID); Line 462: $url = wp_get_shortlink($comment->comment_post_ID); \wp-content\plugins\social\social.php (2 hits) Line 140: $url = wp_get_shortlink($post->ID); Line 1121: $shortlink = wp_get_shortlink($post_id);There were also two instances in the README.txt file but those can be ignored.
The only problem is when you do this it will truncate the other content in your Tweet, e.g. https://twitter.com/SeattleBubble/status/257904154129874944
Forum: Fixing WordPress
In reply to: wordpress and openXThanks for that link, pixelgeek. The old fix stopped working for me after the 2.8 update (it broke posting and other things) but the fix you linked looks like a better solution.
Forum: Fixing WordPress
In reply to: wordpress and openXI have experienced this same problem, although in my case it was completely screwing up the display of my site whenever I would insert an OpenX local-mode code into the left sidebar.
The above change to wp-db.php did the trick, but I will of course be looking for a better long-term solution. Perhaps that change can be made into a little plugin?
Forum: Plugins
In reply to: Plugin modifies the_content but stalls out if the_content is too longThanks for the response, Otto. To answer your questions, it’s a list of 373 cities, and they’re all just plain A-Z text with no special characters or even digits. It bombs out on long pages whenever there’s any match, not on any specific one.
I’ll give the preg_replace array a try. Thanks for the suggestion.
Forum: Plugins
In reply to: Plugin modifies the_content but stalls out if the_content is too longOooh! I made a little progress in narrowing down the problem!
So the regular expression I’m using in the preg_replace is this:
'/'.$city.'(?!((?!<\/?blockquote>).)*<\/blockquote>)(?![^<]*(<\/a>|>))/s'But if I take out this part:
(?!((?!<\/?blockquote>).)*<\/blockquote>)And just leave it as this:
'/'.$city.'(?![^<]*(<\/a>|>))/s'The error goes away. Anybody have any idea why the blockquote part of my regex would cause php to crash like that?
Forum: Plugins
In reply to: Plugin modifies the_content but stalls out if the_content is too longOkay, since nobody has responded still, here’s the specific code I’m implementing in my plugin. It’s pretty simple.
There’s an array named $cities that has a bunch of stuff in the form of ‘city’ => “http://linkhere.com/”
After the array is this:
foreach ($cities as $city => $linkedcity) { $text=preg_replace('/'.$city.'(?!((?!<\/?blockquote>).)*<\/blockquote>)(?![^<]*(<\/a>|>))/s','<a href="'.$linkedcity.'" title="'.$city.' Real Estate Statistics on Redfin">'.$city.'</a>',$text); } return $text;Then I just run add_filter(‘the_content’,’linkify’) where ‘linkify’ is the name of the function the array and the code above are located in.
When I run this on a page that’s over 5.5KB (or so) it crashes as described above.
Is there anyone that can help me with this?
Forum: Plugins
In reply to: Plugin modifies the_content but stalls out if the_content is too longStill more details… Server logs show an entry of “Premature end of script headers” every time this happens. Looks like something is timing out? It doesn’t take long at all for it to spit out the blank page, so I can’t imagine I’m hitting any 30-second execution limits or anything.
Forum: Plugins
In reply to: Plugin modifies the_content but stalls out if the_content is too longOh, I should note that another symptom is that when attempting to load a post or page that’s too long, a core dump occurs, dumping a ~27MB file into my WordPress root.
Forum: Fixing WordPress
In reply to: query_posts(“cat=#”) not workingAll right so it turns out I thought of one more thing that I hadn’t tried.
I thought about what plugins I was using that mess with the categories, deactivated Ultimate Category Excluder, and tried again.
Ta-da, everything works fine. So a word of warning to anyone using that plugin, it messes up the ability to properly run query_posts.