Search Results for 'test'
-
AuthorSearch Results
-
July 30, 2007 at 1:37 am #51579
In reply to: Full Content of Most Recent Post on Front-Page?
fel64
MemberThat’s great! Passing parameters is just giving the function some data to work with.
$latestpost->topic_idis the topic ID. There are probably some functions liketopic_title()andlink_to_topic()or similar that you can use to get the title and link. They too will need the topic ID passed as a parameter, so if those are the actual functions it could betopic_title( $latestpost->topic_id );
July 30, 2007 at 1:10 am #51578In reply to: Full Content of Most Recent Post on Front-Page?
outchy
Memberwait, i got this to work to display the name:
<?php echo get_user_name($latestpost->poster_id); ?>and this to make it into a link to the person’s profile:
<a href="<?php user_profile_link($latestpost->poster_id); ?>"><?php echo get_user_name($latestpost->poster_id); ?></a>now all i need is to display the topic title and make it a link … i need help with this one please
July 29, 2007 at 10:06 pm #2187Topic: How to evaluate server speed?
in forum Troubleshootingriddle
MemberI’m in the process of setting up a bbPress installation (my first) at a new hosting provider (also my first time with them).
Subjectively, things seem a bit slow. Is there a tool for testing response time on a generic PHP hosting provider? Maybe a PHP app for very gentle stress testing?
Failing that, what sort of response time should be considered normal in bbPress’s self report in the comments at the bottom of the page? My top page currently says, “2.490 – 8 queries.” (That’s with a nearly-empty database.)
If there are serious problems with this host, I’d like to figure it out now, before I get settled in and launch.
Thanks.
July 29, 2007 at 5:18 pm #59450In reply to: How to link to favorites of logged user
_ck_
ParticipantOh if you are trying to do it from an integrated WordPress you’ll need to do this:
<?
if function_exists("get_currentuserinfo") {global $user_ID;}
else { $user_ID=bb_get_current_user_info( 'id' )}
if ($user_ID) { echo '<a href="/forums/profile.php?id='.$user_ID.'&tab=favorites">favorites</a>';} ?>untested – change /forums/ to whatever your bbpress path is.
July 29, 2007 at 4:43 pm #51574In reply to: Full Content of Most Recent Post on Front-Page?
outchy
Memberyes, that worked, thank you.
i’m going through the template-functions.php trying to find how to display the last poster’s username and his/her profile link, as well as the link to the topic itself but the only ones i can get to work are these:
<?php echo $latestpost->post_text; ?>
<?php echo $latestpost->poster_id; ?>
<?php echo $latestpost->post_time; ?>
any suggestions?
July 29, 2007 at 1:46 pm #59539In reply to: “My Threads” – User Specific Views
Sam Bauers
Participant> Any idea what I could be doing wrong here?
Are you using the latest trunk or the standard 0.8.2.1 release?
Latest trunk won’t work with the above code.
July 29, 2007 at 11:57 am #59244In reply to: Plugin: Plugin browser for bbPress
_ck_
ParticipantWeb compression is on an “offered/accepted” handshake of sorts.
It would not affect clients that do not support gzip.
Everytime IE or Firefox (etc.) requests a webpage, it tells the server “I support gzip” in the headers and then if the server supports it, it sends it that way.
Technically compression can be forced through the server – if trac is under the same litespeed server as wordpress/bbpress then it’s just a matter of making sure it’s enabled.
A quick test shows both the svn+trac are using apache, so depending on which version it’s either a matter of building with mod_gzip (for apache 1.3.x) or if apache 2.0 they need to just add a couple of easy httpd.conf directives.
Really though, Matt knows how good litespeed is over apache, both the trac+svn should on litespeed. I bet it could even work with the free 150 connection version instead of buying a license.
July 29, 2007 at 11:35 am #59532In reply to: “My Threads” – User Specific Views
_ck_
ParticipantUgh. So that breaks a view things I’ve done.
I’m waiting for an addition to the plugin svn and I’ll just update there at this point. I also missed checking if the user is logged in, now fixed.
I don’t run the newest trunk so I don’t have a way to test. Looks like I’ll have to setup a test account and install it again.
and I just put the finishes on a nice dropdown view box too…

function views_dropdown() {
$views_dropdown='<form name="views_dropdown" id="views_dropdown">
<select size=1 name="views_dropdown_select" onchange="if (this.selectedIndex != 0) {location=this.options[this.selectedIndex].value;}}">
<option value="#">SHOW ME
> </option>';
$views=get_views(); foreach ($views as $view => $title ) {
$views_dropdown.='<option value="'.get_view_link($view).'">'.$views[$view].'</option>';
}
$views_dropdown.='</select></form>'; echo $views_dropdown;
}July 29, 2007 at 11:30 am #59531In reply to: “My Threads” – User Specific Views
Sam Bauers
ParticipantYou should be aware that views are registered differently in the latest versions in trunk. Views are now constructed using the BB_Query class.
See the latest Support Forum plugin for a way to use both the new and old, although it is wrapped in a Class in there so the basic idea is:
if (is_callable('bb_register_view')) { // Build 876+
$query = <SOME ARRAY ACCEPTABLE TO BB_QUERY>;
bb_register_view('myview', __('My view name'), $query);
} else { // Build 214-875
add_filter('bb_views', 'my_addView');
add_action('bb_custom_view', 'my_processView');
}July 29, 2007 at 9:03 am #59030In reply to: Plugin: Private Forums v4.0
_ck_
ParticipantOh figured out how to fix the moderator’s profile, very easy to do when using my additional function – just attached more “where filters”:
function private_forums_filter_private($where,$prefix=''){
if (function_exists("private_forums_custom_get_options")) {
$private_forums = private_forums_custom_get_options('private_forums');
foreach($private_forums as $forum => $role) {
if(!private_forums_check_user_access_to_forum($role)) {
$where.=" AND ".$prefix."forum_id != ".$forum." ";
}
}
}
return $where;
}
add_filter( 'get_latest_topics_where', 'private_forums_filter_private');
add_filter( 'get_latest_posts_where', 'private_forums_filter_private');
add_filter( 'get_recent_user_replies_where', 'private_forums_filter_private');
add_filter( 'get_recent_user_threads_where', 'private_forums_filter_private');July 29, 2007 at 7:20 am #59528In reply to: “My Threads” – User Specific Views
_ck_
ParticipantI haven’t seen them (doesn’t mean it doesnt exist) but I’ve figured out the framework on how to build and attach a view if you’d like to copy my homework

This is the code I whipped up for “most-views” and “least-views” (which requires the view count plugin to be installed (and inserting the views column in view.php)
function most_views_views( $views ) {
global $views;
$views['most-views'] = 'Topics with the most views';
return $views;
}
add_filter('bb_views', 'most_views_views');
function least_views_views( $views ) {
global $views;
$views['least-views'] = 'Topics with the least views';
return $views;
}
add_filter('bb_views', 'least_views_views');
function most_views( $view ) {
global $bbdb, $topics, $view_count;
if ($view=='most-views') {$sort="DESC";}
if ($view=='least-views') {$sort="ASC";}
if ($view=='least-views' || $view=='most-views') {
$limit = bb_get_option('page_topics');
$where = apply_filters('get_latest_topics_where','');
$most_views = $bbdb->get_results("SELECT topic_id FROM $bbdb->topicmeta WHERE meta_key='views' ORDER BY cast(meta_value as UNSIGNED) $sort LIMIT $limit");
foreach (array_keys($most_views) as $i) {$trans[$most_views[$i]->topic_id] =& $most_views[$i];} $ids = join(',', array_keys($trans));
$topics ="SELECT * FROM $bbdb->topics WHERE topic_status=0 AND topic_id IN ($ids) $where ORDER BY FIELD(topic_id, $ids)";
$topics = $bbdb->get_results($topics);
$view_count = count($topics);
$topics = bb_append_meta( $topics, 'topic' );
}
else {do_action( 'bb_custom_view', $view );}
}
add_action( 'bb_custom_view', 'most_views' );As you can see a new view requires both 1. an action 2. a filter
Easy once you’ve seen it, but try figuring it out from scratch!
This bit adds the title to view pages (missing by default in bbpress)
function bb_get_view_title($title) {
if (is_view()) {$title = get_view_name(). ' « ' . bb_get_option( 'name' ); }
return $title;
}
add_filter( 'bb_get_title', 'bb_get_view_title' );July 29, 2007 at 4:25 am #59475In reply to: {Request plugin:} auto complete tags
Sam Bauers
ParticipantThis is fixed in the latest trunk. I believe, the WordPress tag closing function has been moved across to bbPress.
July 29, 2007 at 3:35 am #51572In reply to: Full Content of Most Recent Post on Front-Page?
outchy
Memberok cool, thank you. it’s doing something so that’s good

this is what i’m using:
<?php
$latestpost = $bbdb->get_row("
SELECT *
FROM $bbdb->posts
WHERE post_status = 0
LIMIT 1
");
?>
<?php echo $latestpost->post_text; ?>it’s displaying the first post from forum 3 for some reason, not the most recent post. i’ve posted a few new posts since then in other forums and it never changes on the front page, it still shows that first post from that forum 3. any idea how come?
(thanks for your help on this)
July 29, 2007 at 3:16 am #51571In reply to: Full Content of Most Recent Post on Front-Page?
fel64
MemberSure that’s possible.

You want a query that gives you the last post. Forget anything messing around with the forum or the topic. You want the last post, right?
There’s no API function to do this AFAIK, so you will have to use a query. I think the structure could go something like this:
$latestpost = $bbdb->get_row("
SELECT *
FROM $bbdb->posts
WHERE post_status = 0
LIMIT 1
");And then
$latestposthas$latestpost->post_text, poster_idand so on. But unfortunately not filtered, so you’d need to apply all those. Which is a bit nasty.But this is all unchecked and unresearched, you’ll need to play around with it.
All this is is a bare start.
July 28, 2007 at 9:32 pm #51569In reply to: Full Content of Most Recent Post on Front-Page?
fel64
Member$forum_one_topicsis not an array which is why it’s failing (although I’m surprised it’s not).Do you actually want the 1 latest topic from forum 1? Then use
$bbdb->get_row()instead ofget_results()and stop treating it as an array (basically, just take out theforeachpart since you don’t have several, and replace$topicwith$forum_one_topics).If you want all the topics from forum one, then take out the LIMIT 0, 1 bit from the query which as I understand it would give you only one result.
Also, you have some malformed HTML just under
span gray.July 28, 2007 at 9:28 pm #59520In reply to: subforums and markup
fel64
Memberfel64, the string is internal to bbpress, not the template loop.
Fair enough, shoulda checked that. So I went and looked through the code, you know, to find the problem. bb has quite an interesting structure there. Couldn’t find the problem, though, so I looked at the code in the .8.2.1 version and it’s missing a bit.
It’s fixed in trunk. Claire, upgrade to the latest version and it’ll work just fine.
July 28, 2007 at 8:44 pm #51568In reply to: Full Content of Most Recent Post on Front-Page?
outchy
Membersure, here is line 13:
foreach($forum_one_topics as $topic) :and here is the surrounding stuff:
<h2><?php _e('Latest Post'); ?></h2>
<?php
$forum_id = 1;
$forum_one_topics = $bbdb->get_results("SELECT * FROM $bbdb->topics WHERE forum_id = $forum_id ORDER BY topic_time DESC LIMIT 0,1") ?>
<?php
foreach($forum_one_topics as $topic) :
$forum_one_topic_posts = get_thread( $topic->topic_id); ?>
Re: <a>"><?php topic_title(); ?></a>
<span class="gray">
<a>">
<?php echo $topic->topic_last_poster_name; ?></a> said:</span> <span class="justify"><?php echo $forum_one_topic_posts[0]->post_text;
endforeach;
?></span>July 28, 2007 at 6:05 pm #59511In reply to: subforums and markup
_ck_
ParticipantIf you mean so topics in sub-forums do not show up on “latest discussions” I whipped this up to solve that:
function filter_front_page_topics($where){
// $exclude_forums=array ("8"); // enable this to manually specify specific forums by id #
$forums = get_forums(); foreach ($forums as $forum) {if ($forum->forum_parent) {$exclude_forums[]=$forum->forum_id;}} // exclude ALL sub-forums
if ( is_front()) {foreach($exclude_forums as $forum) { $where.=" AND forum_id != ".$forum." "; }}
return $where;
}
add_filter( 'get_latest_topics_where', 'filter_front_page_topics');
add_filter( 'get_latest_posts_where', 'filter_front_page_topics');July 28, 2007 at 4:26 pm #2178Topic: Working on new theme…
in forum Themesrefueled
MemberI am working on a new theme and would like your opinions/suggestions:
http://test.refueled.net/forum/
Once its done I will be releasing it.
Thanks in advanced.
nate.
July 28, 2007 at 2:36 pm #52657In reply to: Plugin: [REL] Signature
_ck_
ParticipantOkay I have a working prototype.
Who wants to beta test?
http://ckon.wordpress.com/2007/07/28/new-plugin-bbpress-signatures/
Okee well just let me know.
Not responsible for any melted servers or sudden calls from the voyager probe.
July 27, 2007 at 10:06 pm #51562In reply to: Full Content of Most Recent Post on Front-Page?
fel64
MemberI don’t know off the top of my head. What I’d do in this case, as for pretty much every question that’s asked, is open my copy of bbPress and look around in the files. So that sort of thing sounds like a template tag, so I’d look at bb-includes/template-functions.php, then search for “profile_link” or a couple other similar terms if I couldn’t find it.
This time I tested it and searching for “profile_link” will pretty quickly get you the function you want. But finding out what you need is something you can pretty easily do yourself most of the time.

(Not that there’s a problem with you asking anything, this is just teach-a-man-to-fish thinkin’.)
July 27, 2007 at 10:34 am #2170Topic: Plugins SVN Problem
in forum TroubleshootingLMD
ParticipantThere appears to be a problem with the SVN for plugins.
I’ve had a user who downloaded the latest version of Avatar Upload, only to find the contents of sub-folders to be empty — even though the files are present in the repository when I browsed source in Trac (in both the Trunk AND latest Tag). Somehow they are missing in the automated ZIP download.
The file structure is:
trunk/ (and also 'tags/0.7/')
additional-files/
avatars/ (contents missing in the ZIP)
my-templates/ (ditto)
.Is this a one-off blip or is it a bug? Either way, can it be fixed?
July 27, 2007 at 2:40 am #49631In reply to: Emoticons For bbPress?
mazdakam
MemberPlease stop pasting huge chunks of code on the forums. Use something like http://pastebin.ca/.
ok i will do
listen i want to tell you somthing important
i downloaded bbEmoticons-0.72 and unpacked it and then send it to my plugin then i go to my admin and try to active it but it show fattal error my bbpress is .8.2.1so i tried to download 6th and every time it didnt active!
now i come and copy the code form here and open new file in php and save it then try to upload it and active it

it get active and work! what is wrong?
do you test bbEmoticons-0.72 from the original download address i think there is somthing wrong in the original file
please try it once for me
July 26, 2007 at 10:35 pm #2166Topic: The page isn’t redirecting properly.
in forum Troubleshootingericender
MemberThe 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.
Hi all, I’m not able to get bbPress working. [Firefox, IE, Safari, Opera] can’t show the pages linked from the index page. I’m testing bbPress for use in a University setting.
The site is here: http://www2.csulb.edu/misc/sandbox/board/
A test installation.
Things you might need to know before giving me a solution:
PHP 4.4.1, MySQL 5
Apache 1.3.3.7
The directory it is residing in is a virtual directory.
mod_rewrite is enabled
I tried both true/false for $bb->mod_rewrite
What else do you need to know? Please help.
July 26, 2007 at 4:11 pm #59417In reply to: plugin idea: “report this post”
_ck_
ParticipantAnd a report post plugin is born – tested working!
Needs a few features but gets the job done for now:
<?php
/*
Plugin Name: report post
Description: allows members to report a post to admin/moderators
Plugin URI: http://CKon.wordpress.com
Author: _ck_
Author URI: http://CKon.wordpress.com
Version: 0.1
*/
/*
instructions: install, activate and put <? report_post_link(); ?> in your post.php template where you want the link to be seen
optional in stylesheet: a.report_post {color:red;}
todo:
1. don't let them report more than once on a post - or more than too many times per minute/hour
2. auto-delete post if more than x reports from different members
3. auto-post report into a specified moderator's forum #
4. maybe ajax xmlhttp call instead of real form post so there's no page movement
5. it's technically possible to alert a browing mod with a popup directing to the reported post, no email needed
*/
function report_post_link($post_id=0) {
if (bb_current_user_can('participate') ) :
$post_id= get_post_id( $post_id );
if (get_post_author_id($post_id) != bb_get_current_user_info( 'id' )) {
echo '<a class=report_post title="report post to moderator" href="#post-'.$post_id.'" onClick="report_post('.$post_id.');return false;">Report</a>';
}
endif;
}
function report_post_form() {
if (bb_current_user_can('participate')) :
if (isset($_POST['report_post_id']) && isset($_POST['report_post_reason'])) {
echo '<scr'.'ipt type="text/javascript">alert("Thank you for the report. A moderator has been notified.");</scr'.'ipt>';
$post_id=intval($_POST['report_post_id']);
// todo: custom response if invalid id, problem sending email - maybe flush output buffer so member gets alert faster
$to = bb_get_option('admin_email');
$subject = " reported post by member for moderation";
$headers = "From: ".bb_get_option('admin_email');
$message ="report by: ".bb_get_current_user_info( 'name' )." (".bb_get_current_user_info( 'id' ).") email: ".bb_get_current_user_info( 'email' )."rnrn";
$message.="report: ".wordwrap(strip_tags(substr($_POST['report_post_reason'],0,255)),70)."rnrn".get_post_link($post_id)."rn";
$message.="post by: ". get_post_author($post_id)."rn"; // add "member since", total posts, blah blah
$message.="rnrnReport Trace:rn";
$message.="IP: ".$_SERVER['REMOTE_ADDR']."rn";
$message.="Host: ".gethostbyaddr($_SERVER['REMOTE_ADDR'])."rn"; // useful but can add a few seconds
$message.="Agent: ".$_SERVER['HTTP_USER_AGENT']."rn";
$message.="Refer: ". $_REQUEST['refer']."rn";
$message.="URL: http://".$_SERVER['HTTP_HOST'].$GLOBALS["HTTP_SERVER_VARS"]["REQUEST_URI"]."rn";
mail( $to, $subject, $message,$headers);
}
echo '<form method="POST" name="report_post_form" id="report_post_form" style="display:none;visibility:hidden"><input type=hidden name="report_post_id"><input type=hidden name="report_post_reason"></form>';
echo '<scr'.'ipt type="text/javascript">
function report_post(post_id) {
var report_post_reason = prompt("Please enter a short but descriptive reason why a moderator needs to review this post:", "");
if (report_post_reason && report_post_reason.length>9) {
document.report_post_form.report_post_id.value=post_id;
document.report_post_form.action="#post-"+post_id;
document.report_post_form.report_post_reason.value=report_post_reason;
document.report_post_form.submit();
} else {alert("report cancelled, incomplete description"); }
}
</scr'.'ipt>';
endif;
}
add_action('bb_foot', 'report_post_form');
?> -
AuthorSearch Results