Search Results for 'code'
-
Search Results
-
Topic: Profile-menu disappeared!?
I’d like to change the profile page to look more like a blog, so I want to have the user’s info on the left and the topics that they’ve started listed down the right complete with text and a link to the topic to read the comments (replies). Right now I’m stuck on how to show the text of the topic post. Here’s what I’ve got so far:
<?php foreach ($threads as $topic) : ?>
<div class="post">
<h2 class="posttitle">
<a href="<?php topic_link(); ?>"><?php topic_title(); ?></a>
</h2>
<p class="postmeta"><?php printf(__('posted %s ago'), get_topic_start_time()); ?>
<div class="the_content">
<?php post_text(); ?>
</div>
</div>
<?php endforeach; ?>
but post_text() just returns the text of the first topic for all the topics, instead of each topic showing the text that it’s supposed to.
Thanks for any help…
(by topic, I mean the first post of a thread – just so we’re clear)
Topic: Error for tags.php
I’ve just installed bbforum to test and play around with, but have hit a niggling problem – I hope people can help.
In the breadcrumb navigation for tags, urls of this forum work:
http://www.learning2goblog.org/bbforum/tags.php?tag=bbpress
but if I click onto the “Tags” link in the breadcrumb navigation (i.e. I open
http://www.learning2goblog.org/bbforum/tags.php), the page does not load, and in Firefox I get the message
The page isn’t redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
* This problem can sometimes be caused by disabling or refusing to accept cookies.
Has anyone else experienced this problem? I’m using the latest version of bbforum, no permalinks.
Thanks for any help you can give.
As I had said in my blog post, I have those plugins up and running, but.. the problem is that those that register on the bbPress forums, are not able to post comments on my blog, as their username..?
Plugins are:
WordPress Integration (0.7)
bbPress Integration (0.72)
Display-Name
bbPress Post (0.02)
It’s not pulling their email address, and their nicknames have to be assigned by me, in the blog’s control panel, under USERS?
I’d hate to have to edit each USER on my blog, so they can post as their “nickname or username”.. rather then “Anonymous”..
Anyone with suggestions, and so forth?
spencerp
Topic: Help with a plugin
I wanted a way to let the topics listed under “Latest Discussion” expire after a while (eg., no longer show up if there has been no activity after a week), so I wrote this little plugin which works alright, except it messes up the forums. Each forum, when clicked, shows all posts no matter what forum they’re in.
Any help would be appreciated. This is a simple script, I just copied the $where code from functions.php and added the filter, then added my “expire after 7 days” addition. Any help would be appreciated, I’m probably just not seeing something simple.
function get_where_plugin() {
$forum = (int) $forum;
$where = 'WHERE topic_status = 0';
if ( $forum )
$where .= " AND forum_id = $forum ";
if ( !empty( $exclude ) )
$where .= " AND forum_id NOT IN ('$exclude') ";
if ( is_front() )
$where .= " AND topic_sticky <> 2 AND SUBDATE(NOW(), INTERVAL 7 DAY) < topic_time "; // 2nd part is my addition
elseif ( is_forum() || is_view() )
$where .= " AND topic_sticky = 0 ";
return $where;
}
add_filter ( 'get_latest_topics_where', 'get_where_plugin' );
To see how it’s misbehaving, you can go to http://www.rayd.org/forums/ and just click on either forum (General Chat or New Forum Discussion) and see that both contain the same data. However, it’s working great on the front page.
Topic: Private Forum script
I needed desperately a script that would restrict all access to unregistered users so I wrote one. But I am an absolute beginner so don’t know no nothin’ about elegance or whatnot but I just tested it in my installation and it works.
The thing is naturally bb_press has authentication scripts. but to make all you website protected you need to put this in your header.php. However bb-login.php, which your users need to login also use the header.php, so I had to make sure that this small script runs on all pages EXCEPT the login page.
Here’s the script:
<?php
$login_page = $bb->path . ‘bb-login.php’;
if ($_SERVER != $login_page) {
if ( !bb_is_user_logged_in() ) {
header(‘Location: ‘ . $bb->domain . $bb->path . ‘bb-login.php’);
} else { }
}
else { }
?>
How to Use it:
1. Copy paste the above code to your my-templates/header.php AT THE VERY TOP of the file. Make sure you leave no empty space before the <?php line (use something like TextPad – it’s free). So you header should look like:
<?php
$login_page = $bb->path . ‘bb-login.php’;
if ($_SERVER != $login_page) {
if ( !bb_is_user_logged_in() ) {
header(‘Location: ‘ . $bb->domain . $bb->path . ‘bb-login.php’);
} else { }
}
else { }
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN” ….
That’s it. Since I use the values you provided in you BBPRESS setup all the paths should be correct.
Like I said I am complete newbie, so use at your own risk. BACKUP your header.php, or if something goes wrong just delete the script you just added.
Hope it works for you,
Caner