Search Results for 'code'
-
AuthorSearch Results
-
February 20, 2009 at 4:49 pm #71961
In reply to: latest wordpress stories (code)
_ck_
ParticipantYup “order by rand()” is very handy.
I used it for a mod for WordPress years ago to make a “random” category which is very useful.
It could even be done to make a “random topics” view in bbPress but not sure how useful that would be.
It’s fine for casual use but keep in mind for larger tasks it’s very slow and makes mysql purists shudder.
February 20, 2009 at 4:45 pm #71960In reply to: latest wordpress stories (code)
deadlyhifi
Participantand my final correction on the random thing!
$stories = $bbdb->get_results("SELECT post_title, guid FROM site_posts WHERE post_type='post' AND post_status='publish' ORDER BY post_date_gmt DESC LIMIT 0,10");
shuffle($stories);previous example was getting a random 10 from all posts.
This get’s 10 latest posts, then randomizes them with the ‘shuffle’.
cheers!
February 20, 2009 at 5:15 am #71959In reply to: latest wordpress stories (code)
deadlyhifi
ParticipantOn my version I’m fetching 10 latest rows, randomizing, then displaying 5 stories.
$bbdb->get_results("SELECT post_title, guid FROM site_posts WHERE post_type='post' AND post_status='publish' ORDER BY rand() LIMIT 0,10");Admittedly, I didn’t make the correct alterations to the previous example. Anyway, it should give people an idea of what to do.
oh, and _ck_ I hadn’t spotted your earlier post – it would have made it a lot easier for me to figure out if I had!
February 19, 2009 at 11:54 pm #4891Topic: Looking for someone to port HTML/CSS template to bbPress
in forum Themespatrick10128
MemberHi,
I’m looking for someone who has had a bit of experience with theming bbPress to help me port a HTML/CSS template (which I have also made into a WordPress theme) over to bbPress. It should be relatively easy seeing as the design is simple and already coded.
Please contact me at patrick.devivo [at] gmail.com if you know someone or are willing to help me out.
February 19, 2009 at 11:10 pm #71958In reply to: latest wordpress stories (code)
_ck_
ParticipantFYI, the
if ($i <= 4) {is not needed because you already do a LIMIT on the query.Related topic:
February 19, 2009 at 6:17 pm #71957In reply to: latest wordpress stories (code)
Ipstenu (Mika Epstein)
ModeratorFYI, this only lists 4 posts but is FREAKIN AWESOME!
February 19, 2009 at 5:41 pm #4885Topic: latest wordpress stories (code)
in forum Themesdeadlyhifi
ParticipantJust made a query in my forum functions.php to display the 5 latest stories from WordPress. Pretty basic but it may help someone:
// get WP news
function wpnews() {
global $bbdb;
$stories = $bbdb->get_results("SELECT post_title, guid, post_date_gmt FROM wp_posts WHERE post_type='post' AND post_status='publish' ORDER BY post_date_gmt DESC LIMIT 0,4");
foreach ($stories as $story) {
if ($i <= 4) {
echo '<li><a href="' . $story->guid . '">' .$story->post_title . '</a></li>';
$i++;
}
}
}then call it on your forum with <?php wpnews() ?> and style to suit.
February 19, 2009 at 10:48 am #4881Topic: Hire – Coder/Designer
in forum Themesrockin
MemberI’m looking for talented coders/designer who can help me theme a bbPress forum to my needs.
Contact me directly at:
andreas [at] jaxvine.com
February 18, 2009 at 11:47 pm #71943In reply to: Can’t delete or modify users as admin
WPAlex
MemberIpstenu, thanks. To solve this problem I delete all messy code from profile-edit.php of Refresh theme and replace it with default one from Kakumei.
February 18, 2009 at 6:46 pm #71946In reply to: Theme: TooNewsy
_ck_
ParticipantGood fix, I got distracted after I posted that and never did it myself.
There’s also a border issue on images but I think most themes have that problem and it’s another thing I have to enforce in it’s own stylesheet.
actually, you are causing it here:
#posts .post .content a img {
border: 1px solid #ccc;
}You may way to limit it to topic pages and not any kind of table like latest-discussions.
February 18, 2009 at 2:12 pm #71778In reply to: Posts added to all MU blogs showing on one forum???
Ipstenu (Mika Epstein)
ModeratorHeh
Politics are a different beast all together in terms of readership. BUT to be constructive:SALON (political left)
– Blog posts are presented like forum topics here: http://open.salon.com/cover.php?view_sort=recent
– The authors’ blogs are listed here: http://open.salon.com/people.php
Actually that’s just a blog. It’s probably a WPMU sort of blog, but it’s ‘presented like forum topics’ because that’s their design. A very straightforward one at that. That’s it. Same with Pajamas, actually. Which I find a much nicer design, as I prefer blogs to give a little excerpt hint at what’s to come.
February 18, 2009 at 8:40 am #68941In reply to: reCAPTCHA for bbPress
mvds
MemberWorks like a charm for me
Saves me about 5 bot registrations per day
February 18, 2009 at 12:05 am #71923In reply to: Custom User Groups
farly
MemberOkay I had to change it a bit:
<?php
/*
Plugin Name: Add custom usergroups
Description: Adds custom usergroups
Author: fel64, farly
*/
add_filter('get_roles', 'add_custom_usergroups');
function add_custom_usergroups( $roles ) {
//define custom groups
//$groups['GROUPNAME'] = array('CAPABILITIES LIKE','HUMAN GROUPNAME', array(EXTRA CAPABILITY, EXTRA CAPABILITY));
$groups['probemitglied'] = array('member','Mitglied auf Probe', array());
$groups['mitglied'] = array('member','Mitglied', array());
$groups['kernmitglied'] = array('member','Kernmitglied', array());
$groups['koordinator'] = array('moderator','Koordinator', array());
$groups['leiter'] = array('administrator','Leiter', array());
foreach ($groups as $key => $g) {
$roles[$key] = $roles[$g[0]]; //duplicate member capabilities
$roles[$key]['name'] = __($g[1]); // change name
foreach( $g[2] as $capability ) {
$roles[$key]['capabilities'][$capability] = true; // add extra capabilities
}
}
return $roles;
}
?>February 17, 2009 at 11:03 pm #71922In reply to: Custom User Groups
farly
MemberThanks!
I modified this approach slightly and ended up with this:
<?php
/*
Plugin Name: Add custom usergroups
Description: Adds custom usergroups
Author: fel64, farly
*/
add_filter('get_roles', 'add_custom_usergroups');
function add_custom_usergroups( $roles ) {
//define custom groups
$groups['mitglied_probe'] = array('Mitglied auf Probe', array('rulord_level1'));
$groups['mitglied'] = array('Mitglied', array('rulord_level1', 'rulord_level2'));
$groups['kernmitglied'] = array('Kernmitglied', array('rulord_level1', 'rulord_level2', 'rulord_level3'));
$groups['koordinator'] = array('Koordinator', array('rulord_level1', 'rulord_level2', 'rulord_level3', 'rulord_level4'));
$groups['leiter'] = array('Leiter', array('rulord_level1', 'rulord_level2', 'rulord_level3', 'rulord_level4', 'rulord_level5'));
foreach ($groups as $key => $g) {
$roles[$key] = $roles['member']; //duplicate member capabilities
$roles[$key] =& $user[$key]; //convenience
$user[$key]['name'] = __($g[0]);
foreach( $g[1] as $capability ) {
$user[$key]['capabilities'][$capability] = true;
}
}
return $roles;
}
?>It works for me so far
February 17, 2009 at 7:23 pm #71942In reply to: Can’t delete or modify users as admin
Ipstenu (Mika Epstein)
ModeratorFlip back to the default themes and see if the problem persists. If no, it’s the theme. If it persists, collect the following:
1) bbPress version
2) Plugins
3) WP version (if integrated)
and report back!
February 17, 2009 at 5:09 pm #71921In reply to: Custom User Groups
johnhiler
MemberYou can use fel64’s unofficial plugin to add a new Role:
https://bbpress.org/forums/topic/adding-a-new-user-type?replies=6#post-9210
I’ve used this together with Hidden Forums, and it works really nicely!
February 17, 2009 at 12:46 pm #69481In reply to: del Sol Owners Club
Shagalaga
MemberNice

but some usernames are missing(or hidden?)
February 17, 2009 at 6:59 am #71917In reply to: WordPress Permalinks in BBpress
coolsaggu
MemberHi chrishajer,
Thanks for the suggestion…….
but they are bound to change sometime in future.
I also read your article. Thanks I was bit struggling with this thing also(getting WP info in BBpress). But even if I get the information, how would i construct the Permalink structure of the WP.
I have been following the WP code to write my own functions, but they seem to go pretty deep and I dont know whether creating a copy of these functions in BBpress would be safe or not.
February 17, 2009 at 1:45 am #71885In reply to: “pretty” permalinks in bbPress
chrishajer
ParticipantThere is no restart required for modifying an .htaccess file: Apache reads that for every access.
The permalinks are not related to PHP4 vs PHP5.
The permalink stuff is definitely 100% right now, at least for the 0.9.x series.
I’m assuming you made the change in the admin to turn on the permalinks, in conjunction with adding the .htaccess rewrite rules?
I had to insert this into my .htaccess to turn OFF the multiviews before the rewrite rules would work:
Options -MultiViewsFebruary 16, 2009 at 2:08 pm #71916In reply to: WordPress Permalinks in BBpress
chrishajer
ParticipantIt would be easiest to hard code them if they don’t change very often.
_ck_ described how to get bbPress information inside WordPress. Maybe something similar would work in an opposite fashion to get WordPress information inside bbPress:
February 15, 2009 at 11:51 pm #71255lookfab
MemberWill there be a version of 0.9 that supports php4, or is 1.0 the next time we’ll see php4 support in an official (beta) release?
February 15, 2009 at 6:19 pm #71214In reply to: List all Tags?
circuit
Membermy line 2529 was blank so i replaced the nearest thing i could see that was similar to
return "<small> - <a href="/forum/profile.php?id=$tag->user_id">$poster</a></small> [<a href='$url' class='delete:$list_id:tag-{$tag->tag_id}_{$tag->user_id}' title='$title'>×</a>]";now, either as a result of this or as a result of the updates described in this page:
https://bbpress.org/forums/topic/theme-template-files-to-change-for-10#post-23794
…my tag area no longer automatically reloads when a tag is added, even though the tag is committed to the db and can be seen if you reload the page. i am a bit worried that users are going to be confused by this. i bet i have replaced the wrong line, but i am not sure…
February 15, 2009 at 4:58 pm #71678Asbjørn Ulsberg
MemberI’m having the same problem and it seems that the WP integration for whatever mysterious reason forces the MySQL connection into “localhost” mode. I’ve configured both WP and bbPress to connect to another MySQL host, but still it seems like bbPress is trying to connect to “localhost”.
I added a print_r($args) inside the db_connect_host() function and found that the function is called twice and the first time the credentials, host, etc., are correct and the second time they aren’t. The second time the function is called, the credentials are for some reason set to the ones of the logged in user. So somewhere in the bbPress code, authentication is done not with the values stored in bb-config.php, but with the username and password of what’s stored in the session cookie and the host is then set to “localhost”.
I don’t know how to investigate this problem any further.
February 15, 2009 at 3:33 pm #71666anandsrinivasan
MemberWorks like magic..You are a rockstar, Chris!!

Thanks again..
February 15, 2009 at 3:17 pm #71664chrishajer
ParticipantYes, probably. You can see if that’s the problem by logging in as keymaster and going to the Admin section, then Settings > General (sometimes this is the URL http://wat2.com/bb-admin/options-general.php). Once there, change “Pretty Permalink Type” to “None” and then try your forum. If your forum is usable after that, then yes, it’s because bbPress is trying to use permalinks, but you have not set up the .htaccess file with rewrite rules.
You can create the rewrite rules by accessing this URL in your forum:
http://wat2.com/bb-admin/rewrite-rules.php
Now, take the output from that browser window and paste it into a .htaccess file in the forum root (
/home/web/htdocs/whatever/wat2/.htaccess) on your server. Once that’s done, change the permalink setting back to one of the other two options (Numeric or Name based) and then try accessing topics and the profile page in your forum.https://bbpress.org/documentation/faq/#pretty-permalinks
(I don’t recommend the
Options +MultiViewsline, but that does work for some people instead of creating the rewrite rules in the browser). Be sure you’re logged in as keymaster before you try to access http://wat2.com/bb-admin/rewrite-rules.php or it won’t work. -
AuthorSearch Results