Search Results for 'code'
-
AuthorSearch Results
-
May 7, 2007 at 6:41 am #1832
Topic: Announce new topics via Twitter
in forum Pluginsbruz
MemberHi there,
nowadays everybody is using twitter for everything – so why don’t use it for something useful?
I think it would be nice to announce a new topic to a specific twitter-account so that people will know when to visit the forums.
May 6, 2007 at 11:21 pm #51236In reply to: Anonymous post
gh3
Memberi had a look at code trying to do something in this way, but i wasn’t able to find the right function to hook… i can find the pre_post_form and post_form, this one allows me to work only after the post form so i think that in this very moment there is no way to do it, or better there is no way using a plugin…
May 6, 2007 at 11:21 pm #57507In reply to: Theme problem with new topic page from front page
fel64
MemberI really do
This Patrick Ehrlund? He’s great – even if he does have a flash website
I’d argue that the coolness of appearance is worth it, since the login form’s not exactly rocket science. I think it’s still pretty distinguishable anyway. Mockups:
http://img513.imageshack.us/img513/5090/ochreblackuf9.jpg
http://img338.imageshack.us/img338/5758/ochrewhiteyh4.jpg
That’s just suggestions if you’re interested, no need to give it further thought
Test account to see the problem with the HTML, didn’t realise Chris had already fixed it. My bad.
May 6, 2007 at 10:56 pm #57506In reply to: Theme problem with new topic page from front page
csl749
MemberAha – thanks very much chrishajer! I’ve just noticed that there’s a surplus /div in footer.php. I’ve removed it and all is now well, as far as I can tell. Though it’s strange how it only affected that one page (?!). Thanks for pointing me in the right direction.
Thanks fel64 – glad you like the design of the site!
The header pic was designed by a friend of mine, Patrick Ehrlund. I’m torn about the login background – it does look much better without the white background, but also more difficult to read. I might play with some font colours to get something that displays nicely over the header pic colours.
A test account? What do you mean? I’ll help if I can.
May 6, 2007 at 10:44 pm #57403csl749
MemberHmm. I tried the path (it’s thrown up in the error anyway so I assume it’s the correct path!) but it’s still not working, providing me with an error.
Everything works anyway, as I built the forum theme up around the main site, but it’d be nice to know that I could call BB and WP functions if I wanted, without worrying. Oh well…
Thanks very much for the kind help though Fel64!
May 6, 2007 at 3:43 pm #51234In reply to: Anonymous post
Duchemin
MemberUsers on my forum posted 1 or 5 messages, they don’t need registration. But in bbpress database there is no field of Name (post linked with user by poster_id).
How to make ‘Anonymous post’?
May 6, 2007 at 3:35 pm #57505In reply to: Theme problem with new topic page from front page
fel64
MemberIt’s a really nice site and I love the header. The login form would fit in more if you remove the
background: #FFFFFF
property in the CSS.Could you make a test account please, so we can see the HTML?
May 6, 2007 at 12:31 pm #57394In reply to: Trying to integrate bbpress with my wordpress
fel64
MemberYes. Put the
Secondary
inMain
, get rid of its margin, add the CSSfloat
property to bothSecondary
andDiscussion
– onefloat: right
, onefloat: left
. That will make it work.May 6, 2007 at 12:29 pm #57192In reply to: Show exact date of post? (not freshness)
fel64
MemberI see. Sorry, I thought that was just an example for the format.
How’s this instead?
<?php global $post;
$lalaposttime = date( 'D M Y', strtotime( $post->post_time ) );
echo $lalaposttime; ?>May 5, 2007 at 7:21 pm #57494In reply to: Code for different size tags
fel64
Member<?php tag_heat_map(); ?>
will do that.May 5, 2007 at 6:55 pm #1827Topic: Code for different size tags
in forum Installationabc12345
MemberWhat is the code used to make the list of tags with their fonts different sizes?
May 5, 2007 at 12:21 pm #57190In reply to: Show exact date of post? (not freshness)
fel64
MemberWhat does it show? Something completely crazy or something slightly wrong?
You can set your timezone in
config.php
, just change$bb->gmt_offset
to whatever you want.May 5, 2007 at 12:17 pm #55855fel64
MemberAck, I’m sorry but the stupid easy mistake is mine. This will only work for blog posts which have a corresponding topic in bbPress, so for any blog posts you made before installing the bbPress Post plugin it won’t work. Should’ve thought about that before copying you the code.
function forumreplylink() {
//must be called from within the loop yadda yadda
global $post;
$rl = get_option( 'wpbb_path' ) . '/topic.php?id=';
$tid = felblogtotopicid( $post->ID );
if( $tid ) {
echo '<a href="' . $rl . $tid . '">Reply!</a>' . "n";
} else {
comments_number('No Comments','1 comment','% comments');
}
}Replace the old
forumreplylink()
with this and it will either show the reply link or a link to the comments. If you only want it to show the reply link but no link to comments, just take that comments line out.May 5, 2007 at 12:32 am #55854Griffology
MemberOK here’s my file
<?php
/*
Plugin Name: HFFIB
Plugin URI:
Description: Helper function for integrating bbPress into your theme.
Version: 0
Author: fel64
Author URI: http://www.loinhead.net/
*/
function felblogtotopicid( $felpostID ) {
global $table_prefix, $wpdb;
$posts_table = $table_prefix . "bbpress_post_posts";
$topic_id = $wpdb->get_var("SELECT topic_id FROM '$posts_table' WHERE 'post_id' = $felpostID LIMIT 1;");
return $topic_id;
}
function forumreplylink() {
//must be called from within the loop yadda yadda
global $post;
if( $post ) {
$rl = get_option( 'wpbb_path' ) . '/topic.php?id=';
$tid = felblogtotopicid( $post->ID );
echo '<a href="' . $rl . $tid . '">Reply!</a>' . "n";
} else {
echo 'ouch!';
}
}
?>I am running a custom theme, but it’s called in the spot as the original wordpress comments were and those worked fine. Here’s how I’m calling the function:
<div class="details">
<a>"><?php comments_number('No Comments','1 comment','% comments'); ?></a>
<span class="tool">Category: <?php the_category(', '); ?></span>
<span class="tool"><?php akst_share_link(); ?></span>
<span class="tool"><?php forumreplylink(); ?></span>
</div>Still getting the error, and no ‘ouch’ anywhere… I do have bbpress_post plugin running, is it supposed to or does this replace it? I’m thinking it has to be running, I’m just trying to elimate a stupid easy mistake I’ve made.
May 5, 2007 at 12:25 am #55853fel64
MemberThat’s strange, it works for me. At a guess the root of it is that $post doesn’t exist, or that $post->ID is nonexistant.
Can you replace
function forumreplylink() { ... }
with:function forumreplylink() {
//must be called from within the loop yadda yadda
global $post;
if( $post ) {
$rl = get_option( 'wpbb_path' ) . '/topic.php?id=';
$tid = felblogtotopicid( $post->ID );
echo '<a href="' . $rl . $tid . '">Reply!</a>' . "n";
} else {
echo 'ouch!';
}
}If it outputs ouch we’ll know that a missing global $post is indeed the problem. You are using it inside The Loop, aren’t you?
May 5, 2007 at 12:07 am #55852Griffology
MemberThanks for the help, but my error is now:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘LIMIT 1’ at line 1]
SELECT topic_id FROM
wp_bbpress_post_posts
WHEREpost_id
= LIMIT 1;after the error it adds the reply function but with an empty id: IE: “http://www.website.com/topic.php?id= “
May 4, 2007 at 11:23 pm #55851fel64
MemberThat’s very simple; go to wp-admin > Options > Discussion and set it so comments are off. You can also modify your template by deleting all the code for comments.
To get the ‘discuss in forums’ link, simply open your template file, and replace the
<?php comments_popup_link(' make a comment', '1 comment', '% comments','','comments off'); ?>
or similar with this:<?php forumreplylink(); ?>
That’ll give you what you want. Note that you’ll need to put
felblogtotopicid()
into a WP plugin, like so:<?php
/*
Plugin Name: HFFIB
Plugin URI:
Description: Helper function for integrating bbPress into your theme.
Version: 0
Author: fel64
Author URI: http://www.loinhead.net/
*/
function felblogtotopicid( $felpostID ) {
global $table_prefix, $wpdb;
$posts_table = $table_prefix . "bbpress_post_posts";
$topic_id = $wpdb->get_var("SELECT topic_id FROM <code>$posts_table</code> WHERE <code>post_id</code> = $felpostID LIMIT 1;");
return $topic_id;
}
function forumreplylink() {
//must be called from within the loop yadda yadda
global $post;
$rl = get_option( 'wpbb_path' ) . '/topic.php?id=';
$tid = felblogtotopicid( $post->ID );
echo '<a href="' . $rl . $tid . '">Reply!</a>' . "n";
}
?>If you do that, you have to take it out of the hack should you implement it.
May 4, 2007 at 9:59 pm #55850Griffology
MemberThanks fel64. I’m looking to do away with the wordpress comments completely, just shut them off. However the bbpress post plugin posts the “discus in forms(0)” link at the end of the post. I have a bar at the bottom of each post and would like to format it in there. I’ve opened bbpress_post.php and saw the output of the post gets thrown into 1 variable. I would like to call a function in my wordpress php files, for example index.php, that calls the function from bbpress_post.php to display the “discuss in form” link.
Hope that makes sense, but after read the thread you linked I don’t think it’s quite what i’m looking for. I’ll read it again thought as I’m tired.
Thanks again.
May 4, 2007 at 8:51 pm #57412In reply to: *seamless* wordpress integration
Vili
ParticipantThe way I have integrated the two over at http://akirakurosawa.info/ is by editing the bbPress template so that it calls the WordPress headers instead of the bbPress ones.
I presume that you have installed both WordPress and bbPress, and that you have integrated their user databases and installed the required plug-ins as outlined at https://bbpress.org/documentation/integration-with-wordpress/ .
So, if you now go through the template files for your bbPress installation, you will need to replace all instances of “<?php bb_get_header(); ?>” with the WordPress command “<?php get_header(); ?>”. The same thing goes for the footers, so you change all instances of “<?php bb_get_footer(); ?>” to “<?php get_footer(); ?>”.
However, in order to get that to work properly, I have also edited my WordPress template so that the (WordPress) header and footer files contain everything except for the actual content that is going to be shown on the page. In other words, all the “container” DIV-elements and such are opened in the header and closed in the footer. While this is perhaps not absolutely necessary, it makes your life easier.
Finally, I use a boolean check in the WordPress header to see whether I am serving a bbPress page, and modify the header information accordingly. While I currently set the boolean myself by including
<?php global $forumpage;
$forumpage = TRUE; ?>at the very beginning of each relevant bbPress template page (i.e. those pages that call the header files), fel64 has pointed out that one could simply use a variable that bbPress uses anyway, for example $bbdb.
I use these checks to modify the title:
<?php if ($forumpage == TRUE) {
bb_title();
echo " :.: AKN&I";
} else ...to add the forum feed:
<?php if ($forumpage == TRUE) bb_feed_head(); ?>
as well as do some other things (disable Ultimate Tag Warrior’s meta tags for the page, etc.).
So, it takes a little bit of playing around with your templates, but in the end it is doable without any actual hackery.
May 4, 2007 at 7:27 pm #55849fel64
MemberThere are a few things you can do. This WP plugin will, using also the bbPress Post plugin, show replies from the appropriate thread in your forum under your newspost, plus links to the thread to reply to it. You can also transfer existing comments; you need to be careful to only do it once, but that can also be found in that thread. It hasn’t yet been successfully made so that you can reply to the forum from the wordpress part of the site, as far as I know, but I’m sure it’s possible and will be done.
So it’s perhaps 2/3rds of the way there.
May 4, 2007 at 5:05 pm #55848Griffology
MemberMatt, have you finished this. I’ve tried to do it myself but with no luck I always end up throwing a sql error.
May 4, 2007 at 4:36 pm #55364In reply to: Pretty Permalinks Not Working
serimu
MemberI checked it again, and it is partially working. Forum links are accessible, but topic and others are not. I again tried three combination
1) just adding multipleviews to htaccess = not working
2) adding this solution = not working
# BEGIN BBPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /forum/
Options +MultiViews
</IfModule>
# END BBPress3. adding the code generated by rewrite-rules.php. = partially working
May 4, 2007 at 4:03 pm #55363In reply to: Pretty Permalinks Not Working
serimu
Member+1
I did also all the things(at least three or more times, and even I create a mirror template for bbpress to match with my wordpress template when I was tired of trying the same things to make permalinks to work),. So, for those people who uses Godaddy;
It is not working with Godaddy. (Correction: It works for me, read below)
But it only took a couple of hours to update my wordpress, install and integrate bbpress with wordpress (even, partially, templates). For now, I will not move to another hosting company for permalink option. But it is a bit annoying because rewrite rules are working on Godaddy. I have installed wordpress(10 or more different websites), and drupal(3 or more websites), and no problem with permalinks. When you create your htaccess file for the first time, you need to wait for a couple of hours (in avarage 2-3 hours). After that first initialization, every change in htaccess are applied instantly. Namely you just need to wait only for the first time.
I also tried a simple redirect to check my htaccess file in forum root directory. And it was working.
So as the creator team of bbpress is the same for wordpress. And as wordpress is ok with godaddy. The team may suggest an alternative way for rewrite rules. I dont know much about rewrite rules. And I believe the file (bb-admin/rewrite-rules. php) creates correct rules for the most of the servers.
SOLUTION:
I wrote all the above information and then I think to add my config.php file to here. So I find out something, that I dont use akismet, so I add
//
to beginning of that line, namely://$bb->akismet_key = ''; // Example: '0123456789ab'
and it is working now
May 4, 2007 at 8:41 am #57392In reply to: Trying to integrate bbpress with my wordpress
fel64
MemberThat’s because you’re using a left-hand margin on your sidebar and your main div to push them to the right.
<div id="main">
<div id="discussions">
<div id="secondary">That’s roughly your HTML structure.
Main
is the full width of the central white bar, so there’s no way you can getSecondary
next to it.Discussions
is a sub-part ofMain
, and it’s pushed over to the right by a large margin on the left.Secondary
is not part ofMain
, and pushed over to the far right because it has a humoungous 71% margin.Firstly you want to put
Secondary
into yourMain
div, otherwise there’s no way to do it. Then you need to put either one on the left; the way to do this would be to get rid of its giant margin. That should work.Otherwise, if you’re not doing it by the margin property, you could put
Secondary
intoMain
again, then giveSecondary
andDiscussions
afloat: left;
and afloat: right;
property (or the other way around). If there’s enough room, they should now be side by side – otherwise make them narrower.You can also get rid of the
wrapper
‘sborder
properties, that’s what’s giving you the double-width line.That’s a nice theme you made, though.
May 3, 2007 at 8:14 pm #57390In reply to: Adding a link to forum in my wordpress site
chrishajer
ParticipantFrom the looks of your site, it worked.
-
AuthorSearch Results