Search Results for 'code'
-
AuthorSearch Results
-
February 25, 2007 at 10:13 pm #54965
In reply to: Users Website in Topic
bbpressfriend
MemberHi, öffne die template-functions.php im bb-includes Ordner und editiere die funktion “post_author_url()”. Such einfach in der Datei nach dieser Funktion.
Man kann es mit SEO auch übertreiben. Deine User schreiben wertvolle Beiträge (gerade in deinem Bereich ist jede Zeile Gold wert). Lediglich meine Meinung, mach wie du denkst. Hoffe ich konnte behilflich sein
Steven
February 25, 2007 at 9:06 pm #54338In reply to: Updated to Desmond But Theme Not Working
kirkk
MemberI did everything but it is still the same
February 25, 2007 at 8:17 pm #54268In reply to: Patch: Categories for version 0.8
spencerp
MemberHi Sam, I already got SVN access on my spencerp.net domain.
I just hadn’t did any SVN-ing on the WP blog itself, and the bbPress forums though. I manually uploaded the files, ran install, upgrades when needed..
But, I guess I could though. Just make my way to the forums/ directory, and do a SVN checkout for bbPress right? Here’s how I usually do my SVN checkouts, into a specific folder:
svn co http://svn.automattic.com/bbpress/trunk .
Once I’m done with that, then run the upgrade, right? Then worry about applying the patch for the Forum Categories?
I never applied a “patch” via the SVN way before, I just want to know step by step, briefly even, how-to do this… Do I just slap in the patch URL.. or.. ? Thanks in advanced…
spencerp
February 25, 2007 at 7:59 pm #54821In reply to: Rewriting URLs
marky
MemberWell, I’ve found the solution! Apparently, ModRewrite doesn’t count the query string as part of the URL, so it needs to be addressed separately. These rules did the trick:
RewriteEngine On
RewriteBase /forums/
RewriteCond %{QUERY_STRING} ^t[0-9]+)$
RewriteRule ^viewtopic.php$ /forums/topic/%1 [R,L]February 25, 2007 at 7:34 pm #54337In reply to: Updated to Desmond But Theme Not Working
chrishajer
ParticipantKirkk: that is what the plugin is supposed to do, I think: turn the slashes around. When you pasted the code into that file, did it have line numbers? You should use the plain text version here:
https://trac.bbpress.org/attachment/ticket/575/path-to-url.2.php
Is the my-plugins directory readable (0755 permissions) and the file is readable by the webserver (0644 permissions at least)?
Also, I don’t know the answer to this question, but should it have the .2. in the file name, or should the file be named path-to-url.php? I don’t know if the filename matters at all. I know there was a version one without the 2 in the filename.
Keep plugging away. You’ll get it.
February 25, 2007 at 6:54 pm #54336In 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.
-
AuthorSearch Results