Search Results for 'code'
-
AuthorSearch Results
-
July 26, 2007 at 12:25 am #53777
In reply to: show search form or link to search.php on home page
mazdakam
Memberthis is my coustom code in search-form:
<form action="<?php bb_option('uri'); ?>search.php" method="get">
<p><?php _e('Search:'); ?>
<input type="text" size="70" maxlength="200" name="q" value="<?php echo attribute_escape( $q ); ?>" />
<?php if( empty($q) ) : ?>
<input type="submit" value="<?php echo attribute_escape( __('Search »') ); ?>" class="inputButton" />
<?php else : ?>
<input type="submit" value="<?php echo attribute_escape( __('Search again »') ); ?>" class="inputButton" />
<?php endif; ?>
</p>
</form>July 25, 2007 at 11:56 pm #59393fel64
MemberIn the right place in front-page.php? It has to be inside the loops that go
foreach( $sumthin AS $topic ) { ... }
I’ve just tried it myself and it seems to work. Comment _in_ that line about the span colour so you can test if it’s working at all.
July 25, 2007 at 11:50 pm #59409In reply to: Go to last post in topic
fel64
Member<?php
/*
Plugin Name: Page »
Description: Adds » to the end of topic titles, linking to latest post.
Author: fel64
Version: 0.7
*/
if (!function_exists('is_tags')) {
function is_tags()
{
return is_tag();
}
}
if (is_front() || is_forum() || is_tags()) {
add_filter('topic_title', 'fel_addlatestlink', 101);
}
function fel_addlatestlink($title)
{
global $topic;
$felgtlpl = get_topic_last_post_link($topic->topic_id);
$title = $title . ' <a href="' . $felgtlpl . '"> » </a>';
return $title;
}
?>That’ll add a little double arrow to the name of each topic which goes to the latest.
July 25, 2007 at 11:45 pm #2159Topic: Go to last post in topic
in forum Installationairdrawndagger
MemberI’d like a link on each listed topic that takes you to the last post in the topic. Any help?
July 25, 2007 at 11:39 pm #59392mikelothar
MemberI’m not sure i’m doing it right. The idea is good, but nothing seems to happen. Here’s what i have:
In the plugin:
function fel_indicatenew($title)
{
global $topic, $bb_current_user;
if ( bb_is_user_logged_in() )
{
$feluser = bb_get_user($bb_current_user->ID);
if( ($topic->topic_time > $feluser->last_visit) && ( $topic->topic_last_poster != $feluser->ID ) )
{
//$title = '<span style="color: #9d0a0e;">' . $title . '</span>';
$topic->new = true;
}
}
return($title);
}.. and in the theme’s front-page.php:
<?php if( $topic->new ) : ?>
blah
<?php endif; ?>I’ve also tried:
<?php if( $topic->new ) { ?>
blah
<?php } ?>.. but none of these seem to do anything.
July 25, 2007 at 10:55 pm #49622In reply to: Emoticons For bbPress?
fel64
MemberIt’s not a plugin. Add this to the top of the file, after the <?php:
/*
Plugin Name: Nerr
*/July 25, 2007 at 10:45 pm #56736In reply to: Plugin: Avatar Upload
LMD
ParticipantHow are you installing the plugin? Are you downloading it directly or are you using the ‘Plugin browser for bbPress’ plugin? If the latter, then I think it’s not downloading properly, you need to do it manually by downloading the current ZIP file, unzipping it and follow the instructions in the
readme.txt
file.Here is the Avatar Upload plugin in the bbPRess Plugin Browser, the newest version of the code is always to be found on that page:
https://bbpress.org/plugins/topic/46
Click on the link “Download latest version” — or just click the following download link for now:
July 25, 2007 at 9:58 pm #59391fel64
MemberWhat do Tom and Jerry have to do with any of this?
So replace the code that adds the <span class=””> to this:
$topic->new = true;
Then when you want to find out if it’s a new topic, you do this:
if( $topic->new ) {
//blah
}Should work. Unless I misunderstood your wishes again.
July 25, 2007 at 9:53 pm #59390mikelothar
MemberThen i’m Jerry.
Fel, i think you misunderstood me with the new-post class. I wanted it away from the title, as a new variable of some sort. I guess this plugin is only for the topic text, and can not be modified to my wishes.
July 25, 2007 at 8:59 pm #58658fel64
MemberThat’s the
maxlength
property of input fields.You can still edit the HTML, though, and submit your crazy username. A serverside check is best.
July 25, 2007 at 8:16 pm #58597In reply to: Dashboard has incorrect menu addresses
fel64
MemberLike so? http://192.168.1.29/blogs/bb-admin
I think $bb_path should be
/blogs/test/forums/
and $bb_domain should behttp://192.168.1.29
July 25, 2007 at 7:53 pm #59389Detective
MemberOh, amazing … i feel like Tom from Tom & Jerry :p
July 25, 2007 at 7:14 pm #59388fel64
MemberI don’t know who you have to sleep with to get _that_ plugin. It’s not me. I’m shying away from implementing it because I’m not sure what a good method is.
Do you know if it would be possible to modify the plugin to differentiate between a .no_new_topic and a .new_topic class, for use in CSS instead?
Yeah. Change the function
fel_indicatenew()
to this (note that I’m using classes ‘no-new-topic’ and ‘new-topic’ here):function fel_indicatenew($title)
{
global $topic, $bb_current_user;
if ( bb_is_user_logged_in() )
{
$feluser = bb_get_user($bb_current_user->ID);
if( ($topic->topic_time > $feluser->last_visit) && ( $topic->topic_last_poster != $feluser->ID ) )
{
$title = '<span class="new-topic">' . $title . '</span>';
} else {
$title = '<span class="no-new-topic">' . $title . '</span>';
}
}
return($title);
}July 25, 2007 at 7:14 pm #55653In reply to: What’s integration?
mshutch
MemberNot sure if you have found the solution, but if you put the absolute path to your wp-blog-header.php, it should work fine.
Example:
/home/yourusername/public_html/wp-blog-header.php
.July 25, 2007 at 5:31 pm #56735In reply to: Plugin: Avatar Upload
outchy
Memberi did that and did a diff on all the files and they’re all the same. where do i get the code for avatar.php?
July 25, 2007 at 5:04 pm #59387mikelothar
MemberI have never coded sql, but i agree for some unknown reason that i don’t think it’s difficult to code. I’m just curious as to why noone ever did so before. In my opinion, this is the only obstacle in bbPress.
If anyone should decide to give this a go and try to make the plugin, i just have one (more?) request.. and that is that the plugin also indicates a new topic in the forums part, and not only in the latest discussions. The Indicate New Posts plugin fails to do this.
Who do i have to sleep with to get this plugin?
July 25, 2007 at 4:57 pm #59386Detective
MemberI think it should not be hard to code such a plugin. It would have to create a new database table, like bb_read, with the following fields:
– bb_user
– bb_post
– bb_last_comment_read
This way you could modify the posts query, left joining it with this table. If the join is NULL (please correct me if i’m wrong, i haven’t done these things in a lot of time), then the user has never read the post. If bb_last_comment_read is less than the actual number of comments or replies, then he hasn’t read the last post.
Another interesting alternative is what the folks at wordpress.org are doing … for non-visited links they have a font with a
font-weight: bold
style. So you can see which topics are new.July 25, 2007 at 4:38 pm #59385mikelothar
MemberHi fel.
I already modified the -strong- part, to some <span style=”color: #123456;”>, but i have to admit that i have never heard of the content-before tag for CSS.
I looked at google, i guess the tag looks like :before (or :after), but i also found this page:
http://www.quirksmode.org/css/contents.html
.. which states that it doesn’t work in IE browsers. FreekinĀ“ Microsoft..
Good idea though, but unfortunately IE is too popular.
In my theme i have a table, with two columns. First column is the one i would like to be able to modify (even if only with a CSS tag), second column holds the title of the topic.
Do you know if it would be possible to modify the plugin to differentiate between a .no_new_topic and a .new_topic class, for use in CSS instead?
July 25, 2007 at 4:16 pm #59333In reply to: super beginner :)
fel64
MemberI’m sorry, that was maybe a little bit strong.
(But I see _iframes_ and things just go red …
)
July 25, 2007 at 4:03 pm #59384fel64
MemberDo you want it CSS-driven? It’s trivial to modify the Indicate New plugin. Just look for where it says
<strong>
and</strong>
(near the bottom) and change that to<span class="new">
and</span>
. You can then use content-before to add the NEW or do whatever else.What’s new and what isn’t isn’t yet implemented.
July 25, 2007 at 3:58 pm #58942fel64
MemberWhat would bb be looking up? It knows the link type and it already has
$topic->topic_last_poster_name
as well as$topic->topic_last_poster
.July 25, 2007 at 3:14 pm #59125outchy
Memberawesome, just what i was looking for! thanks
July 25, 2007 at 2:43 pm #59234In reply to: Plugin: Plugin browser for bbPress
Sam Bauers
Participant> update: actually this is not directly your fault, though you are trying to use a bb-admin function that was meant for local file access to do remote file access?
If you check the short “to do” list at the top of the plugin you’ll see that I plan to address that issue in the future. I might just copy and paste the code from that internal function and then hack in my own curl/fopen alternative function.
> If I am not mistaken, you just found a bbpress security loophole.
Explain your concerns, how do you think this would be exploited? If it can be we should patch it up.
> ps. any concerns about eventually 2,000-20,000 bbpress users hammering the svn with so many file downloads to examine all the plugin headers?
36 downloads so far, let’s start worrying at 1,000
July 25, 2007 at 2:03 pm #59396In reply to: Topic Pages
Andrew
MemberNever mind, I found the variable in config.php. Pretty obvious.
'// The number of topics that show on each page.
$bb->page_topics = 15;July 25, 2007 at 10:42 am #2155Topic: Solving Redirecting Problem with Slugs (headers)
in forum Troubleshootingwiseremuska
MemberI encountered with a problem saying that headers were already sent while using slugs with mod_rewrite rules shown in bbpress FAQ.
And just to let people who was or will be up against this problem; i solved it changing the line 168 in bb-includes/pluggable.php
Change the line with this code line :
`?><script>location.href=”<?=$location?>”;
</script><?php`
-
AuthorSearch Results