[wp-hackers] Re :How to share WordPress posts across multiple blogs

pradipta sinha singh.gabu at gmail.com
Sun Feb 14 09:44:13 UTC 2010


Re :How to share WordPress posts across multiple blogs

Thanks a lot both of u, *Dion* and *Hikari *
Actually my only intention in "How to share WordPress posts across multiple
blogs"
is , I want this,

For say, I have a wordpress blog classified.com with a classified/auction
etc
Now when anyone join he get the two option ,Free/Paid
Free members are only show ads ,can not make a post[Subscriber]
Paid members are by default contributor role or author role, i.e. he/she can
create ads or post,
Now The main tweaks is I have another numbers of subdomain like
*auto.classified.com* , *medicalspa.classified.com* etc,
ANd i want to give the paid user a ability that when he add any post in a
category named *AUTO* in main domain[classified.com] ,the post will
automatically inserted or may be just display in auto.classifieds.com

So is that possible ?
and how can i run multiple blogs with a single code base ? and I cant get it
*Dion* ,

"you can get around that by defining WP_SITEURL and WP_HOME in your config
| file dynamically to the hostname that the request came in on to bypass
| that issue." plz explain me more,







---------- Forwarded message ----------
From: "Hikari" <lists at hikarinet.info>
To: <wp-hackers at lists.automattic.com>
Date: Sun, 14 Feb 2010 03:40:18 -0200
Subject: Re: [wp-hackers] How to share WordPress posts across multiple blogs
As I undestood, what he wants is to share posts among sites, but don't share
users.

That would be the oppose of WP MU, which shares users but doesn't share
posts. He also didn't talk about taxonomies, comments, etc.


I believe this specific need can't be accomplished, since posts use users PK
for author. A post created in a site won't have an
author on the others, and no simple way to identify which site its author
is. That may be troublesome.

---------------------------
Hikari -  A Luz ilumina a PAZ
http://Hikari.ws
http://ConscienciaPlanetaria.com

Tenha seu próprio email meunome @ ConscienciaPlanetaria.com.br!:
http://seunome.ConscienciaPlanetaria.com.br


----- Original Message -----
From: "Dion Hulse (dd32)" <wordpress at dd32.id.au>
To: <wp-hackers at lists.automattic.com>
Sent: Saturday, 13 February, 2010 9:02 PM
Subject: Re: [wp-hackers] How to share WordPress posts across multiple blogs


| Whats the Use-case for sharing posts?
|
| If you're trying to have a blog available from multiple domains, the best
| way is to simply use a single WordPress isntance, and direct all the
| domains to that. By default, the Canonical redirection will kick in and
| redirect it to the primary.
| you can get around that by defining WP_SITEURL and WP_HOME in your config
| file dynamically to the hostname that the request came in on to bypass
| that issue.
|
| On Sun, 14 Feb 2010 05:45:52 +1100, pradipta sinha <singh.gabu at gmail.com>
| wrote:
|
| > Hi,
| > I want to share my posts in multiple blogs, I want to use a common post
| > and
| > postmeta table in all my blogs,
| > I am shring user table in multiple wordpress installation websites,
| >
| > A detialed documnetation in sharing account in multiple blog is here
| > http://wpclassipress.com/forum/viewtopic.php?f=11&t=1409
| >
| > Now same way define in cofig.php in child blog and also by the same way
| > editing the capabilities.php in includes folder
| > Can i make the posts and post meta  table a common for  both of the
| > blogs,
| >
| > For say
| >
| >
| > define('CUSTOM_POSTS_TABLE', 'wp_posts');
| > define('CUSTOM_POST_META_TABLE', 'wp_postmeta');
| > define('CUSTOM_CAPABILITIES_PREFIX', 'wp_');
| >
| > and edit the wp-includes/capabilities.php
| > // $this->cap_key = $wpdb->prefix . 'capabilities'; coomnet this line
| >
| > place
| > if (defined ('CUSTOM_CAPABILITIES_PREFIX')) {
| >       $this->cap_key = CUSTOM_CAPABILITIES_PREFIX . 'capabilities';
| >    } else {
| >            $this->cap_key = $wpdb->prefix . 'capabilities';
| >    }
| > //
| > Is that the way to make the psot and postmeta table common ??
| > Kindly help me on that.
| > Thanks




---------- Forwarded message ----------
From: "Hikari" <lists at hikarinet.info>
To: <wp-hackers at lists.automattic.com>
Date: Sun, 14 Feb 2010 04:01:15 -0200
Subject: Re: [wp-hackers] Some Thoughts/Enhancement Ideas In
AndAroundTheCategory Side Of Things
----- Original Message -----
From: "Mark McWilliams" <admin at wpkid.com>
To: <wp-hackers at lists.automattic.com>
Sent: Sunday, 14 February, 2010 12:14 AM
Subject: Re: [wp-hackers] Some Thoughts/Enhancement Ideas In
AndAroundTheCategory Side Of Things


| >> | Bottom line, a site publisher will be better off if they have control
| >> to
| >> | optimize their URL structure.  One of WordPress' biggest current
| >> | weaknesses is the difficulty of control URL structure.
| >
| >I agree with that.
|
| And I'd agree with that statement too, only in certain aspects though,
cause
| at the moment WordPress does a pretty good job! :)


It does a pretty good job when its job is what you need.

If you want a category other then the one with lowest ID in the permalink,
what will you do?


| > Wordpress advantage is that, if we wanna change permalink structure,
| > we can do so once and get all our pages updated, and with the help of
| > a plugin also have old permalinks 301 redirected to new ones.
|
| Yes, I do like how we can change the permalink structure virtually with
the
| click of a button, and we dont need to go pasting certain code in the
| .htaccess file, I can't fault that!

me too :)

Something I hated in Drupal is how we must set everything up before start
adding posts. Because any change, even in configs, will
only reflect in posts done after that change. And fixing stuff is damn hard
on it!



| > But that also makes it harder to get our permalinks the way we want.
| > Drupal's URL Alias is clean and simple, and Pathauto enhances it for
| > what we need. Its problem is that, when Pathauto generated permalink
| > is not what we want, then we must type our desired permalink.
|
| I have never used Drupal before, so can't comment sadly! :(

I've used it and I was happy when I get back to Wordpress without starting
any site over it. And even happier when I developed a
theme with some stuff Drupal does and Wordpress also does with some little
tweaks :)


| > Permalink handling is the kind of thing I believe should be taken off
core
| > and moved to a community plugin, which would have high quality API
| > functions to allow us a lot of customizations and develop plugins to
| > enhance parts of it.
| >
| > This plugin would deal with conflict over different permalink plugins.
And
| > have options to disable specific parts of permalink parsing.
| >
| > That would solve permormance issues. If some parsing code is expensive,
| > just disable it and hook your own, with only the code to deal with your
| > specific need.
|
| If it *had* to become more of a Core Plugin then fine, I guess I'd have to
| go with that, but I'm still quite positive that a few things here and
there
| just need to be changed (maybe upgraded, or rewritten) and maybe some
extra
| options that'd cover the second part of what you're on about. Whatever
| options aren't being used, well they'll not show in the rewrite rules, and
| vice versa, if something in the options is checked, it will show in the
| rewrite rules?
|
| That could, or I imagine, would be a possibility!


Let's say a site that has no pages and has categories in higher priority
than normal (remember those themes that list categories
instead of pages in menu), then we don't need to add pages to URL parsing.

A plugin could be developed to solve that need, removing page parsing,
removing pages reference from admin UI and so on. And of
course removing cat base, and everything would be set.




Also, imagine I wanna use a totally different structure, or just use
permalinks in a way they can't be organized even in a few
structures, so parsing is not usable at all.

In Wordpress that would mean use Custom Permalink plugin, and set custom
permalinks to all posts, categories and maybe even tags
(yeah I know :P ).

I've not checked Custom Permalink code so much to know it, but I BELIEVE it
runs after the whole rewrite_rule code has run, maybe
even when everything else fails and 404 is about to be generated. I don't
even know, if my guess is wrong plz correct me.

If that's how it works, and custom permalinks would be used in every post,
page, category and everything else, then the whole
rewrite_rule code can be disabled, and let the plugin deal with everything.
It it's not possible to be done, a lot of code will be
run without need, making each page load slower worthlessly.


Now, in Drupal, URL Alias deals with resource => alias with a simple page,
very clean and cheap. Just don't install Pathauto and
you're done.

Even better, leave Pathauto there. It only runs when a post is being
published, when it's loaded only URL Alias does the simple
database query. :)



In a Wordpress x Drupal permalink dealing, both have their goods and bads.
But it's easier to implement Wordpress advantages over
Drupal than do the opposite. :(


---------------------------
Hikari -  A Luz ilumina a PAZ
http://Hikari.ws
http://ConscienciaPlanetaria.com

Tenha seu próprio email meunome @ ConscienciaPlanetaria.com.br!:
http://seunome.ConscienciaPlanetaria.com.br




---------- Forwarded message ----------
From: "Hikari" <lists at hikarinet.info>
To: <wp-hackers at lists.automattic.com>
Date: Sun, 14 Feb 2010 05:27:02 -0200
Subject: Re: [wp-hackers] Some Thoughts/Enhancement Ideas
InAndAroundTheCategory Side Of Things




----- Original Message -----
From: "Mark McWilliams" <admin at wpkid.com>
To: <wp-hackers at lists.automattic.com>
Sent: Sunday, 14 February, 2010 12:32 AM
Subject: Re: [wp-hackers] Some Thoughts/Enhancement Ideas
InAndAroundTheCategory Side Of Things




| what's wrong with something like...?
|
| http://www.site.com/contact/ - Which will be a page!
|
| /?post=hello-world
| /?page=contact
| /?taxonomy=people
|
| http://www.site.com/hello-world/ - That'll be the post URL!
|
| /?post=hello-world
| /?page=contact
| /?taxonomy=people
|
| http://www.site.com/people/ - And oddly enough, we have the custom
taxonomy!
|
| /?post=hello-world
| /?page=contact
| /?taxonomy=people
|
| So in theory, what it'll do is search between a POST, PAGE and TAXONOMY
for
| a match! =)
|
| Have I just completely missed the point, or what, to me that looks pretty
| simple!


It's simple to understand, but expensive to run.

My site has 276 posts, 6 pages, 58 categories and 1108 tags. Remember
categories, tags (which were added in 2.1 or 2.3) and now
custom tax are all in a unique table.

If it was implemented as you said, a category URL would first go throu
almost 300 pages rows, (let's not think it would first query
only pages and then only posts, or it would go twice on that table) then
more than 1000 taxonomy rows.

Such queries are expensive because they load whole posts and taxonomies
tables to get only their slug and ID. So cat base optimizes
it, helping Wordpress easily figure out when the URL refers to a category or
tag, "taking taxonomies out of equation". Get a post
structure starting with a number, being it a date or an ID, and you have an
easy way to separate different resources without needing
to query each table.

It's for optimizing it.




That's the disadivantage of Wordpress approach, it requires quering in
resources tables to find out what a URL means, and more than
once!

Now, take a look on how Drupal works:

1) Core: each resource has a fixed permalink of /resource/ID, it's like a
very simple and cleaner Wordpress rewrite rule

2) URL Aliases module: there is a table that links each default permalink to
an Alias, that can be anything and is written by user
upon resource creating (as Custom Permalink plugin works!); by default both
original and alias permalinks return the resource, there
is a way I don't remember anymore how, that makes default permalink redirect
to alias

3) Pathauto module: remebers a bit how Wordpress defines permalinks, we can
set *different* permalink stuctures to *each kind* of
resource, *including each taxonomy type we create*, and it will fill URL
Alias for us


 BUT, Pathauto only does its job AFTER the post is created, we can't see how
it will be before saving, not even its "slug" (I've
just tested it here, not even previewing works, and as long as I know Drupal
doesn't have sheculed posts).

So, or we have a very different permalink we wanna use for that resource, or
we let Pathauto sets it and see how it becomes after
it's created. And if we don't like Pathauto's work, we must edit the post
setting our own Alias.




Pathauto needs improvements, but Drupal *totally* separates
permalink-to-resource detection from resources table, at the same time
we are able to use anything after the site's base URL.

In Wordpress, if we like its permalink structure, it's better than Drupal
best solution. But if we don't, all it lets us do is
change the resource slug, or hack its rewrite rules using custom permalink,
scategory, removing category base, etc. And since it is
so complex, any hack may add bugs.


We should have a simpler and expandable permalink code base, and add rewrite
rules over it (and each or all rules would be disabled
as needed), and add newer and better stuff with ease.



---------------------------
Hikari -  A Luz ilumina a PAZ
http://Hikari.ws
http://ConscienciaPlanetaria.com

Tenha seu próprio email meunome @ ConscienciaPlanetaria.com.br!:
http://seunome.ConscienciaPlanetaria.com.br



_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list