<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>WordPress &#8250; Support User Favorites: alkafy</title>
<link>http://wordpress.org/support/</link>
<description>WordPress &#8250; Support User Favorites: alkafy</description>
<language>en</language>
<pubDate>Tue, 24 Nov 2009 03:37:58 +0000</pubDate>

<item>
<title>mfields on "How to manually generate thumbnails?"</title>
<link>http://wordpress.org/support/topic/282024#post-1114148</link>
<pubDate>Tue, 23 Jun 2009 20:19:54 +0000</pubDate>
<dc:creator>mfields</dc:creator>
<guid isPermaLink="false">1114148@http://wordpress.org/support/</guid>
<description>&#60;p&#62;This sounds awesome!!! Thanks for posting your fix... I'm totally gonna check this out soon as I need to completely need to rework my portfolio.
&#60;/p&#62;</description>
</item>
<item>
<title>alkafy on "How to manually generate thumbnails?"</title>
<link>http://wordpress.org/support/topic/282024#post-1114043</link>
<pubDate>Tue, 23 Jun 2009 18:59:42 +0000</pubDate>
<dc:creator>alkafy</dc:creator>
<guid isPermaLink="false">1114043@http://wordpress.org/support/</guid>
<description>&#60;p&#62;Modded for existing server files instead of upload. Limited to 7 for testing. Hope someone else finds it useful.&#60;/p&#62;
&#60;p&#62;File structure is: /uploads/import/########/image.jpg&#60;br /&#62;
######## is a secret custom field on each post (_origID)&#60;/p&#62;
&#60;blockquote&#62;
&#60;p&#62;$path = realpath('../wp-content/uploads/import');&#60;br /&#62;
$dirs = array_diff(scandir($path),array('.','..'));&#60;/p&#62;
&#60;p&#62;$count=0;&#60;/p&#62;
&#60;p&#62;foreach ($dirs as $ad_number) {&#60;br /&#62;
	if (is_dir($path.'/'.$ad_number)) {&#60;br /&#62;
		$ad_image_path = $path.'/'.$ad_number;&#60;br /&#62;
		$ad_images = array_diff(scandir($ad_image_path),array('.','..'));&#60;/p&#62;
&#60;p&#62;		query_posts('showposts=1&#38;amp;meta_key=_origID&#38;amp;meta_value='.$ad_number);&#60;/p&#62;
&#60;p&#62;		while (have_posts()) : the_post(); &#60;/p&#62;
&#60;p&#62;			foreach ($ad_images as $ad_image) {&#60;br /&#62;
				$count++;&#60;br /&#62;
				$extension = end(explode('.',$ad_image));&#60;br /&#62;
				if (strtolower($extension)=='jpg' &#38;amp;&#38;amp; $count&#38;lt;=7) {&#60;/p&#62;
&#60;p&#62;					$url = get_bloginfo('url').'/wp-content/uploads/import/'.$ad_number.'/'.$ad_image;&#60;br /&#62;
					$file = $ad_image_path.'/'.$ad_image;&#60;br /&#62;
					$post_id = get_the_ID();&#60;/p&#62;
&#60;p&#62;					// Construct the attachment array&#60;br /&#62;
					$attachment = array(&#60;br /&#62;
						'post_mime_type' =&#38;gt; 'image/jpeg',&#60;br /&#62;
						'guid' =&#38;gt; $url,&#60;br /&#62;
						'post_parent' =&#38;gt; $post_id,&#60;br /&#62;
						'post_title' =&#38;gt; preg_replace('/\.[^.]+$/', '', basename($ad_image)),&#60;br /&#62;
						'post_content' =&#38;gt; 'image...'&#60;br /&#62;
					);&#60;/p&#62;
&#60;p&#62;					// Save the data&#60;/p&#62;
&#60;p&#62;					$id = wp_insert_attachment($attachment, $file, $post_id);&#60;br /&#62;
					wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $file));&#60;/p&#62;
&#60;p&#62;				}&#60;br /&#62;
			}&#60;/p&#62;
&#60;p&#62;		endwhile;&#60;br /&#62;
	}&#60;br /&#62;
}&#60;/p&#62;
&#60;/blockquote&#62;</description>
</item>
<item>
<title>alkafy on "How to manually generate thumbnails?"</title>
<link>http://wordpress.org/support/topic/282024#post-1113809</link>
<pubDate>Tue, 23 Jun 2009 15:11:34 +0000</pubDate>
<dc:creator>alkafy</dc:creator>
<guid isPermaLink="false">1113809@http://wordpress.org/support/</guid>
<description>&#60;p&#62;Footnote: What I meant to say - turning it into an SWFUpload made me realize my mistake of using an incorrect path. Knowing that, it's probably not too hard to modify to use existing server files. The function realpath() saved me, but simply designating an absolute path to start should work.
&#60;/p&#62;</description>
</item>
<item>
<title>alkafy on "How to manually generate thumbnails?"</title>
<link>http://wordpress.org/support/topic/282024#post-1113801</link>
<pubDate>Tue, 23 Jun 2009 15:02:22 +0000</pubDate>
<dc:creator>alkafy</dc:creator>
<guid isPermaLink="false">1113801@http://wordpress.org/support/</guid>
<description>&#60;p&#62;I got this working, albeit differently.. (but thank you for mfields - pouring over your code helped.)&#60;/p&#62;
&#60;p&#62;I embedded SWFUpload into a plugin admin page and used an ajax call to bulk upload the pictures that were formerly on my server and attach them. I figured out that my main problem was using an incorrect path for the $filepath variable.&#60;/p&#62;
&#60;p&#62;The shortened version using Post ID 288 as a test:&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;
$save_path = &#34;../../uploads/&#34;;&#60;br /&#62;
$file_name = preg_replace('/[^'.$valid_chars_regex.']&#124;\.+$/i', &#34;&#34;, basename($_FILES[$upload_name]['name']));&#60;/p&#62;
&#60;p&#62;move_uploaded_file($_FILES[$upload_name][&#34;tmp_name&#34;], $save_path.$file_name;&#60;/p&#62;
&#60;p&#62;$url = get_bloginfo('url').'/wp-content/uploads/'.$file_name;&#60;br /&#62;
$file = realpath($save_path).'/'.$file_name;&#60;/p&#62;
&#60;p&#62;$attachment = array(&#60;br /&#62;
	'post_mime_type' =&#38;gt; 'image/jpeg',&#60;br /&#62;
	'guid' =&#38;gt; $url,&#60;br /&#62;
	'post_parent' =&#38;gt; 288,&#60;br /&#62;
	'post_title' =&#38;gt; preg_replace('/\.[^.]+$/', '', basename($file_name)),&#60;br /&#62;
	'post_content' =&#38;gt; 'file: '.$file.' url:'.$url&#60;br /&#62;
);&#60;/p&#62;
&#60;p&#62;$id = wp_insert_attachment($attachment, $file, 288);&#60;br /&#62;
wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $file));
&#60;/p&#62;&#60;/blockquote&#62;</description>
</item>
<item>
<title>mfields on "How to manually generate thumbnails?"</title>
<link>http://wordpress.org/support/topic/282024#post-1112935</link>
<pubDate>Mon, 22 Jun 2009 19:20:19 +0000</pubDate>
<dc:creator>mfields</dc:creator>
<guid isPermaLink="false">1112935@http://wordpress.org/support/</guid>
<description>&#60;p&#62;No problem... I really wish something like this was built into WordPress, but I wish there were a lot of things built into WordPress.... Any way, let me know if you have any problems with this...
&#60;/p&#62;</description>
</item>
<item>
<title>alkafy on "How to manually generate thumbnails?"</title>
<link>http://wordpress.org/support/topic/282024#post-1112562</link>
<pubDate>Mon, 22 Jun 2009 12:55:20 +0000</pubDate>
<dc:creator>alkafy</dc:creator>
<guid isPermaLink="false">1112562@http://wordpress.org/support/</guid>
<description>&#60;p&#62;Thank you, I'll look into that file this afternoon. It's good to hear I'm not alone in trying this :)
&#60;/p&#62;</description>
</item>
<item>
<title>mfields on "How to manually generate thumbnails?"</title>
<link>http://wordpress.org/support/topic/282024#post-1110486</link>
<pubDate>Fri, 19 Jun 2009 23:47:49 +0000</pubDate>
<dc:creator>mfields</dc:creator>
<guid isPermaLink="false">1110486@http://wordpress.org/support/</guid>
<description>&#60;p&#62;I've only ever done this once successfully - via .csv - Here is a link to a script that I used: &#60;a href=&#34;http://mfields.org/_plugins/mf-csv-import.zip&#34; rel=&#34;nofollow&#34;&#62;http://mfields.org/_plugins/mf-csv-import.zip&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I saved the file to the directory where WordPress is installed and ran it through the browser. This script is VERY resource intensive and I was only able to import about 30 records at a time.&#60;/p&#62;
&#60;p&#62;Please note that I'm am only posting this as a reference, the file may or may not work for you, but I hope that it does :)
&#60;/p&#62;</description>
</item>
<item>
<title>alkafy on "How to manually generate thumbnails?"</title>
<link>http://wordpress.org/support/topic/282024#post-1110140</link>
<pubDate>Fri, 19 Jun 2009 18:04:36 +0000</pubDate>
<dc:creator>alkafy</dc:creator>
<guid isPermaLink="false">1110140@http://wordpress.org/support/</guid>
<description>&#60;p&#62;I need to import several hundred images from folders already on the server and attach them to posts. As such, I've written a quick script (and borrowed pieces of some plugins) to test the procedure with one image. &#60;/p&#62;
&#60;p&#62;After upload, 'Full size' reads 0x0 pixels and 'Thumbnail' and 'Medium' are not configured. I'm having trouble finding any helpful documentation on the functions I need to use. Here's my script:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$file=&#38;#39;wm4hd.jpg&#38;#39;;
$filepath=$_SERVER[&#38;#39;document_root&#38;#39;].&#38;#39;/wp-content/uploads/2009/04/&#38;#39;.$file;

// find TYPE
$wp_filetype = wp_check_filetype(basename($file), null );
extract($wp_filetype);
if (!$type) $type = &#38;quot;&#38;quot;;

$title = &#38;#39;wm4hd&#38;#39;;
$content = &#38;#39;&#38;#39;;

$url = &#38;#39;http://www.example.com/wp-content/uploads/2009/04/&#38;#39;.$file;
$file = array(
	&#38;#39;file&#38;#39; =&#38;gt; $filepath,
	&#38;#39;url&#38;#39; =&#38;gt; $url,
	&#38;#39;type&#38;#39; =&#38;gt; $type);
$attachment = array(
	&#38;#39;guid&#38;#39; =&#38;gt; $url,
	&#38;#39;post_mime_type&#38;#39; =&#38;gt; $type,
	&#38;#39;post_title&#38;#39; =&#38;gt; $title,
	&#38;#39;post_content&#38;#39; =&#38;gt; $content,
	&#38;#39;post_type&#38;#39; =&#38;gt; &#38;#39;attachment&#38;#39;,
	&#38;#39;post_parent&#38;#39; =&#38;gt; 288
	);

$id = wp_insert_attachment($attachment, $filepath, 288);
if (!is_wp_error($id)) {
	wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filepath));
	echo &#38;quot;Imported: $filepath ($title)&#38;lt;br /&#38;gt;&#38;quot;;
}&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>flywitness on "Single Login across Multiple Wordpress Installations"</title>
<link>http://wordpress.org/support/topic/162543#post-844263</link>
<pubDate>Wed, 03 Sep 2008 15:15:27 +0000</pubDate>
<dc:creator>flywitness</dc:creator>
<guid isPermaLink="false">844263@http://wordpress.org/support/</guid>
<description>&#60;p&#62;i did it in wordpress 2.6 like this:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://wordpress.org/support/topic/201184?replies=3&#34; rel=&#34;nofollow&#34;&#62;http://wordpress.org/support/topic/201184?replies=3&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;cheers ta
&#60;/p&#62;</description>
</item>
<item>
<title>flywitness on "Single Login across Multiple Wordpress Installations"</title>
<link>http://wordpress.org/support/topic/162543#post-843488</link>
<pubDate>Tue, 02 Sep 2008 17:49:17 +0000</pubDate>
<dc:creator>flywitness</dc:creator>
<guid isPermaLink="false">843488@http://wordpress.org/support/</guid>
<description>&#60;p&#62;the solution linked to is unsolved for 2.6 but closed for comments.&#60;/p&#62;
&#60;p&#62;Does anybody know how this might be done in 2.6.1?&#60;/p&#62;
&#60;p&#62;I'm sure this must be a common situation. I just want one set of cookies that cover the whole domain. I can't ask users to re-login to every part of the site!
&#60;/p&#62;</description>
</item>
<item>
<title>Anonymous on "Single Login across Multiple Wordpress Installations"</title>
<link>http://wordpress.org/support/topic/162543#post-805142</link>
<pubDate>Wed, 16 Jul 2008 11:39:11 +0000</pubDate>
<dc:creator>Anonymous</dc:creator>
<guid isPermaLink="false">805142@http://wordpress.org/support/</guid>
<description>&#60;p&#62;Thanks, it works for me.
&#60;/p&#62;</description>
</item>
<item>
<title>alkafy on "Single Login across Multiple Wordpress Installations"</title>
<link>http://wordpress.org/support/topic/162543#post-711371</link>
<pubDate>Thu, 20 Mar 2008 18:30:30 +0000</pubDate>
<dc:creator>alkafy</dc:creator>
<guid isPermaLink="false">711371@http://wordpress.org/support/</guid>
<description>&#60;p&#62;I'm sorry, I wasn't sure which method Wordpress used. &#60;/p&#62;
&#60;p&#62;In any case, the recommended solution worked without a hitch and I'm very impressed with its simplicity. Thank you, thank you.
&#60;/p&#62;</description>
</item>
<item>
<title>Otto42 on "Single Login across Multiple Wordpress Installations"</title>
<link>http://wordpress.org/support/topic/162543#post-711348</link>
<pubDate>Thu, 20 Mar 2008 17:58:49 +0000</pubDate>
<dc:creator>Otto42</dc:creator>
<guid isPermaLink="false">711348@http://wordpress.org/support/</guid>
<description>&#60;blockquote&#62;&#60;p&#62;&#60;em&#62;I'd really like to transfer the session between the two &#60;/em&#62;&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;WordPress does not use sessions, and if the URL's of the two sites are on different domains, then the cookies cannot be passed from one to the other (browser security restrictions). Therefore what you want is not possible in such a case.&#60;/p&#62;
&#60;p&#62;In multiple folders on the same domain, it can be done, as shown by the link given above.
&#60;/p&#62;</description>
</item>
<item>
<title>jeremyclark13 on "Single Login across Multiple Wordpress Installations"</title>
<link>http://wordpress.org/support/topic/162543#post-711347</link>
<pubDate>Thu, 20 Mar 2008 17:58:10 +0000</pubDate>
<dc:creator>jeremyclark13</dc:creator>
<guid isPermaLink="false">711347@http://wordpress.org/support/</guid>
<description>&#60;p&#62;See if this helps.&#60;br /&#62;
&#60;a href=&#34;http://wordpress.org/support/topic/130259?replies=2&#34; rel=&#34;nofollow&#34;&#62;http://wordpress.org/support/topic/130259?replies=2&#60;/a&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>alkafy on "Single Login across Multiple Wordpress Installations"</title>
<link>http://wordpress.org/support/topic/162543#post-711329</link>
<pubDate>Thu, 20 Mar 2008 17:22:17 +0000</pubDate>
<dc:creator>alkafy</dc:creator>
<guid isPermaLink="false">711329@http://wordpress.org/support/</guid>
<description>&#60;p&#62;Howdy!&#60;/p&#62;
&#60;p&#62;Previous threads have helped me share users between two Wordpress installs, but I ran into a problem: When a user logs into one, they're not logged into the other (and vice versa.) I'd really like to transfer the session between the two and only require users to log in once.&#60;/p&#62;
&#60;p&#62;Here's what I did to share users, if it's helpful. &#34;Secondary&#34; refers to the Wordpress Installation residing within a subdirectory of the &#34;Primary&#34; Wordpress Installation:&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;Added&#60;/p&#62;
&#60;p&#62;define(‘CUSTOM_USER_TABLE’, ‘wp_users’);&#60;br /&#62;
define(‘CUSTOM_USER_META_TABLE’, ‘wp_usermeta’);&#60;/p&#62;
&#60;p&#62;to wp-config.php in &#60;strong&#62;Secondary&#60;/strong&#62; Wordpress root.&#60;br /&#62;
——————————&#60;br /&#62;
Changed&#60;/p&#62;
&#60;p&#62;$this-&#38;gt;cap_key = $wpdb-&#38;gt;prefix . ‘capabilities’;&#60;/p&#62;
&#60;p&#62;to&#60;/p&#62;
&#60;p&#62;$this-&#38;gt;cap_key = ‘wp_capabilities’;&#60;/p&#62;
&#60;p&#62;in capabilities.php in wp-includes of &#60;strong&#62;Secondary&#60;/strong&#62; Wordpress install
&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;Thank you for all your help!
&#60;/p&#62;</description>
</item>

</channel>
</rss>
