Search Results for 'code'
-
AuthorSearch Results
-
February 25, 2007 at 6:54 pm #54336
In reply to: Updated to Desmond But Theme Not Working
kirkk
MemberI think this problem is about my server, i mean the software that my server use. Because i couldnt see any mistake in the config file, but i have realized something, if i could find BBPATH, the codes which create this variable, i would be able to fix the problem…
Thanks
February 25, 2007 at 6:09 pm #54694In reply to: Display latest post from WP
fel64
MemberYup, I know that; I just meant that you could quite simply add it to the arguments you took and it’d be a nice addition. My modified code at the end.
Yeah, it’s mildly annoying that the permalinks aren’t used, but it’s not a killer for me. I’d rather have this functionality than none.
Thanks again for the plugin.
function wp_show_posts( $args ) {
global $bb;
parse_str($args, $r);
if ( !isset( $r['before'] ) )
$r['before'] = "<li>n";
if ( !isset( $r['after'] ) )
$r['after'] = "<br />n</li>n";
$posts = wp_get_posts( $args );
foreach( $posts as $post ) {
echo $r['before'];
echo "<a href='".$bb->wp_home."?p=".$post->ID."'>";
echo $post->post_title;
echo "</a>";
echo $r['after'];
}
}February 25, 2007 at 5:38 pm #54693In reply to: Display latest post from WP
nickbrady
MemberHi, fel64, you can use wp_get_posts() instead of wp_show_posts() and then use a foreach loop, much like the examples in the WP Codex for the get_posts function
You don’t mind that pretty permalinks are not being used? I think it’s a killer, let’s hope some expert can help us.
February 25, 2007 at 5:31 pm #54692In reply to: Display latest post from WP
fel64
MemberFantastic Nick, worked straight out of the box. I really like the way you take arguments as well.
Nicest addition would be a
before
andafter
so that it didn’t have to be a list.February 25, 2007 at 3:38 pm #54691In reply to: Display latest post from WP
nickbrady
MemberHi,
I am writing a plugin for BBPress that shows the latest posts from WP (if WP and BBPress are sharing the same database). It’s still in development, but it already works, you just have to write
<?php wp_show_posts(\"\" ); ?>
in any BBpress template.
As you will see, it works, but it has a problem: it does not show WP’s pretty URLs. I would like to call WP’s get_permalink() function, but it uses many WP functions that are not available when you’re in BBPress.
Any advice on how to do this? Or maybe it would be easier to read WP’s RSS?
Thanks!
Here goes the code of the plugin so far (if you don’t care about pretty permalinks, you can use it, it works):
<?php
/*
Plugin Name: WP Posts
Plugin URI: http://thesandbox.wordpress.com
Description: Get a list of WordPress posts from your bbPress (needs to be integrated with WP, sharing database)
Author: Nick Brady
Version: 0.1
Author URI: http://thesandbox.wordpress.com
Install Instructions:
- If you don't have a /my-plugins/ directory in your bbpress installaltion, create it on the same level as config.php.
- Check out: https://codex.wordpress.org/Template_Tags/get_posts
*/
function wp_get_posts($args) {
global $bbdb, $bb;
parse_str($args, $r);
if ( !isset($r['numberposts']) )
$r['numberposts'] = 5;
if ( !isset($r['offset']) )
$r['offset'] = 0;
if ( !isset($r['category']) )
$r['category'] = '';
if ( !isset($r['orderby']) )
$r['orderby'] = 'post_date';
if ( !isset($r['order']) )
$r['order'] = 'DESC';
$now = bb_current_time('mysql');
$posts = $bbdb->get_results(
\"SELECT DISTINCT * FROM \".$bb->wp_table_prefix.\"posts \" .
( empty( $r['category'] ) ? \"\" : \", \".$bb->wp_table_prefix.\"post2cat \" ) .
\" WHERE post_date <= '$now' AND (post_status = 'publish') \".
( empty( $r['category'] ) ? \"\" : \"AND \".$bb->wp_table_prefix.\"posts.ID = \".$bb->wp_table_prefix.\"post2cat.post_id AND \".$bb->wp_table_prefix.\"post2cat.category_id = \" . $r['category']. \" \" ) .
\" GROUP BY \".$bb->wp_table_prefix.\"posts.ID ORDER BY \" . $r['orderby'] . \" \" . $r['order'] . \" LIMIT \" . $r['offset'] . ',' . $r['numberposts'] );
return $posts;
}
function wp_show_posts( $args ) {
global $bb;
$posts = wp_get_posts( $args );
foreach( $posts as $post ) {
echo \"<li>n\";
echo \"<a href='\".$bb->wp_home.\"?p=\".$post->ID.\"'>\";
echo $post->post_title;
echo \"</a><br/>n\";
echo \"</li>n\";
}
}
?>
February 25, 2007 at 3:21 pm #54944flatworm
MemberI do not know php and html. I’ll search for this code line usind WIN. search to find <link
rel=\"stylesheet\"
I really do not want to be involved in the process of development of bbPress.
All this really makes me think of using Vanilla.
Vanilla looks more professional and developed, but it is 50% bigger in size.
Code is poetry, equaly unconceptional to everyone.
February 25, 2007 at 1:25 pm #54881In reply to: Template Tags
fel64
MemberPage numbers – say a thread has more than 30 replies and falls onto the second page, it’s very irritating having to click the thread’s name and then click again to get to the second page. Next to the page’s name you should simply have the page numbers displayed and clickable, hopefully in a smart way (say showing the first few and the last few). You can see it on this forum, too: say I want to read the second page of posts in the Plugin: Forum Restriction thread, I have to click on the name and then on the second page. Is there maybe even a plugin to list the page numbers next to the page name in the thread listing?
In WordPress you have hooks that let you take actions through your plugin when they’re called, right? I guess bbPress does the same. I specifically want to create an Identicon avatar on registration – it’s not essential, just something I’d like to do. How do I register my plugin to work on that hook, and what hook do I use? Just a list of hooks would be helpful.
February 25, 2007 at 2:53 am #54928AphelionZ
ParticipantYeah, taking it out was a good idea. My forum doesnt use it and making it something that isnt in the core code makes it more useful as a ‘general’ forum right out of the box and not just a forum software for tech support.
February 25, 2007 at 2:41 am #54943chrishajer
ParticipantThat is unstyled because the path to the style.css file is incorrect. Can you look at the source of that html page and find the line that begins:
<link rel="stylesheet"
My guess is that the path to your stylesheet is incorrect. There have been a couple threads about slashes being changed to back slashes improperly:
https://bbpress.org/forums/topic/700?replies=28
Even more relevant for localhost:
https://bbpress.org/forums/topic/730?replies=9
Here is a trac ticket for the backslash issue:
https://trac.bbpress.org/ticket/594
HTH
edit: there will not be slashes before the double quotes in your html source around stylesheet , unlike this post. It’s a bug they’re working on.
February 25, 2007 at 1:24 am #49932In reply to: En español
lonemadmax
MemberVersión para 0.8. En topic/703 hay más.
February 25, 2007 at 1:22 am #54300In reply to: bbPress 0.80 in Spanish
lonemadmax
MemberFrom all those links, I could only get the es_AR one (I’m having some strange problems with my DNS, so it may be just me). So here is my es_ES version.
February 25, 2007 at 12:37 am #54903In reply to: underscore stripped from username?
lonemadmax
MemberAt the end of the plugin you can see:
add_filter('user_sanitize', 'user_sanitize_i18n_fix', 10, 3);
That adds the function defined in the plugin to the
user_sanitize
hook. Grepping the core files foruser_sanitize
, you findreturn apply_filters( 'user_sanitize'
[…] inbb-includes/formatting-functions.php
, in the functionuser_sanitize
. When that function is called with strict = true, it removes what it considers not to be a letter, a number or a ‘-‘ from the first parameter (the provided username), and replaces repetitions of ‘-‘ with just one. So the underscore is removed. When strict is false, underscores are kept. Another effect is that accented characters and other such niceties of international scripts are also invalidated.After doing that, it runs the filters, telling them its result, the original value and the value of strict. If installed,
usernames-i18n-fix
will be one of those filters. It returns the original username value (that is, with whatever characters were there from the beginning) if not in strict mode. If strict is true, it just replaces repetitions of ‘-‘ with only one ‘-‘.So that’s how I read it. But I don’t know if the names really need the sanitazion.
February 24, 2007 at 11:49 pm #54970In reply to: “Target” attribute in all post urls?
ear1grey
MemberIn the long run you’ll keep users more friendly if you don’t dictate how they browse. Most people (even my mum) know about tabbed browsing now and know to middle click to open a link in a background tab.
Also, FWIW, target is not (and never has been) a standard attribute of HTML4 or XHTML, so if you want your pages to validate, avoid it.
Having said that…
The Google Analytics plugin for BBPress filters the content and adds stuff to the anchors, so that should help:
February 24, 2007 at 11:11 pm #54902In reply to: underscore stripped from username?
macwise
MemberLonemadmax…
This seemed to do the trick. I looked at the plugin, and I can’t understand any of that crap. It’s only a few lines of code in the plugin, but it seemed to work. As long as there isn’t a reason why I SHOULDN’T just let it run as it was designed to do, then I’ll leave it the way it is.
Thanks for your suggestion!
February 24, 2007 at 7:59 pm #54911In reply to: Plugin Request: Psuedonyms
AphelionZ
ParticipantHere’s hoping
February 24, 2007 at 7:03 pm #1475Topic: “Target” attribute in all post urls?
in forum Troubleshootingmacwise
MemberAnyone know how I might go about adding the target attribute to all
<a>
elements on my forum? I’d like to keep users there when they are sent to other sites/pages.Thanks
February 24, 2007 at 7:01 pm #50894In reply to: Validation
macwise
MemberTransitional solves ALL my problems…
February 24, 2007 at 6:44 pm #54958In reply to: Cookie Domain Settings?
fel64
MemberHehe, no problem, and glad you like the site. The site came after the pun, if you were wondering …
Not sure what a Jello Mold solution is? All I’ve done is
float: left
ed the sidebar andfloat: right
ed the main content bar. To get the background going all the way down I put them into another div.A lot of the work was already done for me, as I started with the Greenflower WP theme, so it wasn’t a great step from that. Glad you like it, though, really
February 24, 2007 at 4:48 pm #54957In reply to: Cookie Domain Settings?
macwise
MemberThat seems to have done the trick. Thanks for posting. I can’t tell you how much searching/testing/wild uncontrollable arm-waving code experimenting I’ve been doing. I did get the WP cookie domain issue figured out, hence the conflict.
Anyhow, all seems to be in order now, so I am just plum tickled! (no, I don’t normally say ‘plum tickled’. And yes, I really am plum tickled.) So thanks a million to you, fel64, for posting my much needed solution.
P.S. Checked out your site…I like the look of the “blog” area quite a bit. Loinhead, eh? Funny. Are you using a “Jello Mold” type layout solution for your liquid css layout? Anyway, the site looks great…
February 24, 2007 at 4:19 pm #54956In reply to: Cookie Domain Settings?
fel64
MemberYou have to add these lines to your bbPress config.php file – not sure who posted it, but it’s not my idea.
//your try to sync cookies
$bb->cookiedomain = '.myurl.com';
$bb->cookiepath = '/';You also have to edit WP core files I think.
wp-settings.php line 190
FROM
define('COOKIE_DOMAIN', false);
TO
define('COOKIE_DOMAIN', '.myurl.com');I’ve got it set up so at http://www.loinhead.net (and forums.loinhead.net) and it works nicely.
February 24, 2007 at 9:45 am #54905In reply to: Memberlist plugin: need a few testers
Null
MemberHmm we need to talk to make this plugin bbmenu compatible
Still working out some options, but it would be nice if it could detect the menu plugin and if it is add a draggable menu item to it… If not it will ignore this
So it need to check if the table bb_menu excist and then if the memberlist record excist…
Well I will contact you about this when I sort things out
February 24, 2007 at 6:17 am #54400In reply to: REQ: Theme demo switcher like phpBB
lonemadmax
MemberOK, here it is. Notice though that the selection box is added using evil ways. You may be all well and good if you don’t add it, though. More info in the README.
A few modifications and it will become a nice plugin that saves the user preferred theme in the db and id not annoying (and only works for registered users when logged in). Will that be useful to anyone?
February 24, 2007 at 3:12 am #54913In reply to: Error After Upgrade
chrishajer
ParticipantError 28 is a MySQL out of disk space error:
Error code 28: No space left on device
February 24, 2007 at 3:05 am #54877In reply to: Template Tags
chrishajer
ParticipantI think bbPress is still like the Wild West, and is changing so often that writing the docs would be a waste of time. It’s not super complicated, so if you have a question about how to get a specific piece of data, you can always ask here or grep through the code. There are a lot of knowledgeable people here who are very good at writing plugins. Looking through the plugin code is helpful too.
Good luck and share what you learn. Thanks.
February 23, 2007 at 10:41 pm #1466Topic: Integrating Aggrss into bbPress theme?
in forum TroubleshootingCMoseley
MemberI use aggrss to do syndication of my own website’s RSS feeds to the front page (OncTalk) and I want to be able to do the same thing on my bbPress theme (which is nearly identically to my WordPress theme). I’ve setup integration between the two theme systems, and I know it works becuase all of my WordPress Conditional tags and things I’m using in my bbPress theme are working, but when I put in aggrss, I get this error:
Fatal error: Call to undefined function: get() in /usr/home/josh/domains/onctalk.com/public_html/wp-content/plugins/aggrss.php on line 127
When looking up the code on that, I didn’t seen anything blatantly obvious that would cuase a screw up, but im still a beginner at this.
This is the code around line 127 from aggrss.php:
(From line 123-131)
function aggrss($rssurl,$striptags=false,$num=0) {
global $lastRSS;
$lastRSS->CDATA= ($striptags) ? “strip” : “content” ;
$lastRSS->items_limit=$num;
if ($aggr = $lastRSS->Get($rssurl))
return $aggr;
else
return 0;
}
Full view of the code can be found here.
Any help in getting this fixed/solved would be much appreciated.
-
AuthorSearch Results