trivum
Forum Replies Created
-
Forum: Plugins
In reply to: PHP Guru’s Help Needed.Anyone with ideas for this? Thanks.
Forum: Plugins
In reply to: Including Other Files Based on Post IDOK, I think I’ve found the answer:
Create a variable – in my case I named it mytext. Define the variable as the file that is to be included. In my case, I’ve put it in a folder called “extra” inside my theme folder.
<?php
$mytext .= “extra/”.$post->ID.”.htm”;
if (file_exists($mytext)) {
include($mytext);
} else {
die (“Insert whatever text you want to appear here when either there is no post ID – such as on the homepage – or when there is no file corresponding to the post ID in the extra folder.”);
}?>
It seems to be working. Anyone see any possible problems with it? I would appreciate the heads-up if you do.
Forum: Plugins
In reply to: Including Other Files Based on Post IDAccording to PHP gurus you should never use URL in an include but server path…
Thanks for that, moshu. I’ve changed it.
Also, I ran into another problem I hadn’t thought about, which is if the page doesn’t have a post ID – such as the home page or categories page, etc.
So it looks like I found an answer to that. I also put the folder with the text files in my theme folder and so now I’m including them like this:
<?php
if(is_single()) {
include(“extra/”.$post->ID.”.htm”);
}else{
echo “Some standard text.”;
}?>
But now I have one more problem. If for some reason I don’t have enough text files to match the number of posts, how could I get that to output some other type of standard text or to just do nothing?
For example, let’s say I have 224 text files, but then I hit Post #225. I get an error message because there is no 225.htm.
Any suggestions? Thanks.
Forum: Plugins
In reply to: Including Other Files Based on Post IDOh, nevermind. I’ve been looking all morning, and I just stumbled on the answer.
<?php include(“https://www.mainsite/static-content/”.$post->ID.”.htm”) ?>
Seems to work.
Forum: Plugins
In reply to: Bolting on a Script Directory, Has AnyOne ever Done ItYou could try this plugin.
Forum: Plugins
In reply to: Bolting on a Script Directory, Has AnyOne ever Done ItNot sure about the specifics of your question, but a good place to ask about scripts is the Sitepoint Scripts Forum.
Forum: Plugins
In reply to: Plugin To Limit What User Sees?Finally found an answer to this on this thread.
There are two suggestions. The first didn’t work for me, but the second one did.
It also looks like the code has changed a little since that answer, so I just copied the end of the new code into the replacement code, although the orignal replacement code also worked.
I’ll go ahead and give the solution that worked for me.
Go to wp-admin/edit.php and find the lines
wp ("what_to_show=posts$post_status_q&posts_per_page=15&order=$order&orderby=$orderby");
You can delete that, or even better just comment it out so that it’s still there if you need to change things back. You can comment it out by putting /* at the beginning and */ at the end so that it looks like this:
/*wp("what_to_show=posts$post_status_q&posts_per_page=15&order=$order&orderby=$orderby");*/
Now put in the new replacement code:
$thisauthor=''; if (!current_user_can('edit_others_posts')) $thisauthor = '&author=' . $user_ID; wp('what_to_show=posts&posts_per_page=15&order=$order&orderby=$orderby' . $thisauthor);
Forum: Plugins
In reply to: How is he doing this with google adsense?“when you hit “continue reading” button the same ad isn’t in the middle of the article.”
It looks like he’s getting the front page ads the way Kafkaesqui said. When you “continue reading,” it looks lik he’s bringing in a different template file (usually called single.php in most themes … or maybe index.php if you also have a home.php file in your theme). Most people have their single post view (the page with the whole post / one single post) look exactly like the site’s front page, but, in fact, it’s a different page. You can make it look however you like.
Forum: Plugins
In reply to: Plugin To Limit What User Sees?OK, I just noticed something that I hadn’t before. When I’m logged in as Admin, I can filter the Manage Posts by Author, however when I log in as a contributor, that filter isn’t an option.
So at least it seems that filtering out all the other authors completely is very possible (especially with a plugin, which is what I’m hoping for).
It’s a little puzzling to me why the default for someone in a contributor’s role would be to see all the posts on the blog rather than just their own. If they can’t edit those posts, I can’t see why they should be presented with them. They only have to wade through them to find their own.
Forum: Plugins
In reply to: How can Create user just can publish the postI’m not sure that the mini forms plugin will allow users to edit their posts. I was playing with it recently and I don’t think it does. (Or at least the way I was using it. I also had other plugins going that restricted access.)
It sounds like the Role Manager plugin would do the trick. You can give or take away a lot of permissions for different users. So you could allow them to edit their posts, but you could restrict most everything else.
Forum: Plugins
In reply to: Plugin To Limit What User Sees?Thanks for the suggestions.
I already use the Role Manager, and that doesn’t quite do it.
I checked out the other plugin, and that doesn’t do it either. It seems to limit what they can read on the frontend, not on the backend.
Unfortunately, I don’t know how to write the code, but I think I can figure out how to do. Someone can correct me if I’m wrong.
It seems you could check to see the user’s permission level, and if they didn’t have permission to edit other’s posts, you would return only the posts written by them in the Manage Posts section.
It seems simple enough to me, but then, as I said, I don’t know how to code. For those who know about these things, would this be a simple plugin to make?
Forum: Plugins
In reply to: Plugin To Limit What User Sees?Anyone with ideas for this?
Thanks.
Forum: Plugins
In reply to: Anyone recommend a good AUTO RESIZE IMAGE plugin?There’s iMax Width.
Forum: Plugins
In reply to: Inserting Frequently Used TextThanks, LK. I’ll take a look at those plugins.
It’s a good idea to hardcode the text, but the problem is even though it would be everyday, it wouldn’t be every post.
Thanks again.
Forum: Fixing WordPress
In reply to: Problems with Reblog and WordPress 1.5I’ll take a look. Thanks.