NC@WP
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Summarizing Child Pages on Parent PageThat’s not particularly difficult, but a plugin would only work in the content area of the page. If you want to do it elsewhere (in a sidebar or the header or the footer), you’d have to modify your theme instead. Also, you need to specify very precise rules (the kind a computer could follow) for cutting excerpts out of complete page content.
Forum: Fixing WordPress
In reply to: Prevent Author from deleting media files!! ?WordPress is so much more today!
Indeed it is, but many architectural decisions were made well before today…
:)
Personal = 1 user then why have a user management interface?
Because you still need to manage Contributors (users who are only allowed to comment on posts rather than compose their own).
that still give me a problem about how to protect my media against stupid users
That’s not a very dificult problem. I already suggested one possible solution above: do a daily (heck, hourly, if you’re so inclined) incremental back-up of your
uploads
directory and restore periodically. Whatever media has been uploaded will be backed up; if it is ever deleted (accidentally or otherwise), it will be restored in a pretty short order.Forum: Themes and Templates
In reply to: Linking a Separate Domain to WordPressIf you tried setting up the second blog to work off the first blog’s database, you were going with option 2, not 3. Not all hosting companies would allow this setup; many hosting companies set restrictive permissions on the location of the DB client (i.e., they only allow clients to connect from certain IP addresses).
To set up option 3, you need to set up the second blog completely independently from the first. Then, on the first blog, you need to have an RSS feed for the category you want to export into the second blog (this functionality is there already; try acessing
mystandardblog.com/category/X/feed
; it should produce a feed for category X), and on the second blog, a plugin that would import this feed (FeedWordPress should do the trick).Forum: Fixing WordPress
In reply to: Permalink not working. Showing error 404There is no alternative if you’re hosting on Yahoo!. On Yahoo! servers, .htaccess files are forbidden and pretty permalinks will only work if you install (a Yahoo!-patched version of) WordPress via Yahoo! Web Hosting interface. Last I checked, they have not yet patched 2.5.1 to work on their servers, so if you install WordPress via Yahoo! Web Hosting interface, you’ll get 2.3.something.
Forum: Fixing WordPress
In reply to: Authors publishing to different pages.Er, yes what? Do you need subdirectories or subdomains?
If you need subdirectories, all you need to do is to go to Options | Permalinks in your admin interface and create this (or similar) custom permalink structure:
/%author%/%year%/%monthnum%/%day%/%postname%/
This will give you URLs like
site.com/author1/2008/06/12/post-title
If you need subdomains, you can either create them manually and install a separate copy of WordPress on each subdomain or install a single copy of WordPress MU, which will handle subdomains for you (if your hosting setup allows it, that is).
Forum: Fixing WordPress
In reply to: Authors publishing to different pages.The question is meaningless as asked. Is it your way of saying you want to give each author a subdirectory (site.com/author1, site.com/author2, etc.) or a subdomain (author1.site.com, author2.site.com, etc.)?
Forum: Themes and Templates
In reply to: Linking a Separate Domain to WordPressThere are at least three ways of doing it I can imagine:
- Solve the whole thing on the Apache level by rewriting
mysitenet.com/*
tomystandardblog.com/category/X/*
. - Deploy two copies of WordPress storing data in the same database.
mystandardblog.com
would be a regular blog, whilemysitenet.com
would have a specially tweaked theme designed to display only one category. - Deploy two regular and independent copies of WordPress, but install FeedWordPress or similar plugin on
mysitenet.com
and configure it to import the Category X feed frommystandardblog.com
.
Forum: Fixing WordPress
In reply to: Putting an ad under just the FIRST post?Indeed. Something like this:
<?php if ('' == $user_ID) { // user not logged in if (!is_defined('AD_SHOWN')) { ?> <div id="myAd"> <!-- Ad goes here... --> </div> <?php define('AD_SHOWN', true); } } ?>
Thanks for clarification, HandySolo!
Forum: Fixing WordPress
In reply to: Putting an ad under just the FIRST post?what part of the script tells WordPress to show the ad under JUST the first post on the page?
When the first post is displayed,
AD_SHOWN
is not yet defined, so!is_defined('AD_SHOWN')
evaluates totrue
and the ad can be displayed. After the ad is displayed,AD_SHOWN
is defined, so!is_defined('AD_SHOWN')
evaluates tofalse
and no more ads are shown…Forum: Plugins
In reply to: Looking for a plugin to mass create pagesThis is way easier to do from outside WordPress… Create one page, note its ID, and then clone it to your heart’s content via a freeform PHP script or an SQL batch file… Something along the lines of:
<?php // Let's pretend that connection to the DB server // has been established and the DB selected... $myPageID = 1234; $myPostsTable = 'wp_posts'; $select = "SELECT * FROM {$myPostsTable} WHERE ID = '$myPageID'"; $myResult = mysql_query($select); $myPage = mysql_fetch_assoc($myResult); while ($morePagesNeeded) { $myNewPage = $myPage; $myNewPage['post_content'] = 'Content of the Page.'; $myNewPage['post_title'] = 'Page title'; $myNewPage['post_name'] = 'page-slug'; $myNewPage['guid'] = 'https://www.example.com/pages/page-slug'; $firstField = true; $insert = "INSERT INTO {$myPostsTable} SET "; foreach ($myNewPage as $key => $value) { if (strtoupper($key) == 'ID') { continue; } if ($firstField) { $insert .= $key . " = '" . mysql_real_escape_string($value) . "'"; $firstField = false; } else { $insert .= ', ' . $key . " = '" . mysql_real_escape_string($value) . "'"; } } mysql_query($insert); } ?>
Obviously, the fields in
$myNewPage
will have to be populated from somewhere (CSV file or perhaps constructed dynamically) and$morePagesNeeded
has to be replaced with some realistic condition, but I hope you get the picture…Forum: Fixing WordPress
In reply to: Putting an ad under just the FIRST post?Exactly as written in the code. ??
First, WordPress would check if the user is logged in.
Then, assuming the user is not logged in, every time WordPress renders a post, it would check if a constant named
AD_SHOWN
is defined. If it’s not (meaning, it’s the first post being rendered), WordPress would display the ad and define the constant. When posts past first are rendered, the constant will already be defined, so no additional ad displays will take place.Forum: Fixing WordPress
In reply to: Prevent Author from deleting media files!! ?What about having users puplishing their own stuff without editing or deleting other peoples blogs?
Can Role Manager help with this?
You don’t need Role Manager for that. Designating a user as Author allows her to publish her material, but not to edit or delete other users’ material (with the exception of media files, of course). Role Manager would help you if you needed some non-standard roles or wanted to change the permissions for a role already defined.
Hmmm if a person use media in a blog it dosent matter if they delete it in the media gallary does it? it will still be part of the authors post/Blog right? but “just” removed from the library correct?
No. When media files are removed from the gallery, they are deleted from disk. So any posts displaying media that was deleted will show dead links instead.
I am new to wordpress but already hitting some limitations like this I really didnt expect from such a great peace of software with 10000 of plugins
If you read WordPress materials carefully, you will notice that even its developers characterize it as a “personal publishing system” or “personal publishing platform”. Note the word “personal“; collaboration was deliberately de-emphasized in WordPress to make its deployment and operation easier for a less technologically adept user. There are products out there that are built on a different set of premises (Drupal comes to mind), but they are substantially more complex.
Forum: Themes and Templates
In reply to: Adding WordPress To A Website Templatelovelytee11,
I know a lot about css and html
That’s not enough; you need to understand PHP programming as well. Read up on theme development.
Forum: Fixing WordPress
In reply to: Prevent Author from deleting media files!! ?jonimueller,
it seems folly to allow all users to be able to muck around in the media gallery.
It is folly, but that’s the way WordPress is designed. Media files are different from posts and Pages in that there is no ownership information attached to them…
Forum: Fixing WordPress
In reply to: Prevent Author from deleting media files!! ?You can’t. WordPress’ permission system is not that finely granulated. Disk space (and images written on it) are shared property, unlike posts/Pages, which are written into the database…
jonimueller suggested the Role Manager plugin, but I don’t think it can help in your situation. Check out this screenshot: the Role Manager allows you only to allow or forbid uploading files.
One possible solution is not to rely on WordPress for maintaining your media files. It should be possible to back up your
uploads
directory and restore it using either utilities provided by your hosting company or a backup utility residing on your home/office computer. So even if a hapless author does delete a file or seven, they would be restored from backup in a short order… - Solve the whole thing on the Apache level by rewriting