Search Results for 'code'
-
AuthorSearch Results
-
July 26, 2007 at 6:16 pm #2165
ganzua
MemberI just installed 0.8.2.1 and it seems functions.php have changed a lot.
Where is get_profile_info_keys() function now? Signature plugin doesn’t work because you need to insert code in that line.
July 26, 2007 at 5:19 pm #2164Topic: not getting pagination links on forum pages
in forum Troubleshooting_ck_
ParticipantRuh roh, I think I broke something.
No pagination links on forum pages even though
<?php forum_pages(); ?>is there – pagination shows up and works just fine on topic pages however.Seems to work here, any ideas how to debug this other than turning off two dozen plugins?
ps. also someone has to tell me oneday how to change the pagination number count and formatting without hacking the core – how do I alter that default settings array?
July 26, 2007 at 4:43 pm #59418In reply to: plugin idea: “report this post”
_ck_
ParticipantComing soon:
don't allow reports on moderators
don't allow reports from members less than x days old
security check if user is in the right topic for the post being reportedJuly 26, 2007 at 4:11 pm #59417In reply to: plugin idea: “report this post”
_ck_
ParticipantAnd a report post plugin is born – tested working!
Needs a few features but gets the job done for now:
<?php
/*
Plugin Name: report post
Description: allows members to report a post to admin/moderators
Plugin URI: http://CKon.wordpress.com
Author: _ck_
Author URI: http://CKon.wordpress.com
Version: 0.1
*/
/*
instructions: install, activate and put <? report_post_link(); ?> in your post.php template where you want the link to be seen
optional in stylesheet: a.report_post {color:red;}
todo:
1. don't let them report more than once on a post - or more than too many times per minute/hour
2. auto-delete post if more than x reports from different members
3. auto-post report into a specified moderator's forum #
4. maybe ajax xmlhttp call instead of real form post so there's no page movement
5. it's technically possible to alert a browing mod with a popup directing to the reported post, no email needed
*/
function report_post_link($post_id=0) {
if (bb_current_user_can('participate') ) :
$post_id= get_post_id( $post_id );
if (get_post_author_id($post_id) != bb_get_current_user_info( 'id' )) {
echo '<a class=report_post title="report post to moderator" href="#post-'.$post_id.'" onClick="report_post('.$post_id.');return false;">Report</a>';
}
endif;
}
function report_post_form() {
if (bb_current_user_can('participate')) :
if (isset($_POST['report_post_id']) && isset($_POST['report_post_reason'])) {
echo '<scr'.'ipt type="text/javascript">alert("Thank you for the report. A moderator has been notified.");</scr'.'ipt>';
$post_id=intval($_POST['report_post_id']);
// todo: custom response if invalid id, problem sending email - maybe flush output buffer so member gets alert faster
$to = bb_get_option('admin_email');
$subject = " reported post by member for moderation";
$headers = "From: ".bb_get_option('admin_email');
$message ="report by: ".bb_get_current_user_info( 'name' )." (".bb_get_current_user_info( 'id' ).") email: ".bb_get_current_user_info( 'email' )."rnrn";
$message.="report: ".wordwrap(strip_tags(substr($_POST['report_post_reason'],0,255)),70)."rnrn".get_post_link($post_id)."rn";
$message.="post by: ". get_post_author($post_id)."rn"; // add "member since", total posts, blah blah
$message.="rnrnReport Trace:rn";
$message.="IP: ".$_SERVER['REMOTE_ADDR']."rn";
$message.="Host: ".gethostbyaddr($_SERVER['REMOTE_ADDR'])."rn"; // useful but can add a few seconds
$message.="Agent: ".$_SERVER['HTTP_USER_AGENT']."rn";
$message.="Refer: ". $_REQUEST['refer']."rn";
$message.="URL: http://".$_SERVER['HTTP_HOST'].$GLOBALS["HTTP_SERVER_VARS"]["REQUEST_URI"]."rn";
mail( $to, $subject, $message,$headers);
}
echo '<form method="POST" name="report_post_form" id="report_post_form" style="display:none;visibility:hidden"><input type=hidden name="report_post_id"><input type=hidden name="report_post_reason"></form>';
echo '<scr'.'ipt type="text/javascript">
function report_post(post_id) {
var report_post_reason = prompt("Please enter a short but descriptive reason why a moderator needs to review this post:", "");
if (report_post_reason && report_post_reason.length>9) {
document.report_post_form.report_post_id.value=post_id;
document.report_post_form.action="#post-"+post_id;
document.report_post_form.report_post_reason.value=report_post_reason;
document.report_post_form.submit();
} else {alert("report cancelled, incomplete description"); }
}
</scr'.'ipt>';
endif;
}
add_action('bb_foot', 'report_post_form');
?>July 26, 2007 at 2:19 pm #59401In reply to: forum.wp-persian.com
Trent Adams
MemberGreat job! Will it have bbPress support as well! I hope so, or this is not the place to post it

Trent
outchy
Memberawesome
July 26, 2007 at 10:00 am #59152In reply to: BB_Query class and next version of bbPress?
kjted
MemberI’ve not forgotten about this. I will post up some code when i’ve finished. I’ve just written an insertion class too.
July 26, 2007 at 9:54 am #56739In reply to: Plugin: Avatar Upload
LMD
ParticipantOh! I see, the sub-sub folders are empty, I just downloaded it from here myself to check.
When I browsed bbPress’ Subversion repository, the files ARE there — I didn’t forget to commit them! — so somehow the bbPress Plugin Browser (the one on this site, NOT Sam’s plugin) has messed up the ZIP download.
The question is, whether it is a one-off or a systematic problem? Admins? Coders? Any ideas?
To solve your problem outchy (and yes, somehow the identicon section got deleted in your
avatar.phpfile), you can download files directly from the Trac browser.Here is the avatar.php file (long url, sorry):
https://plugins-dev.bbpress.org/browser/avatar-upload/trunk/additional-files/my-templates/avatar.php
You can not save that page itself, but scroll right to the bottom of it and you’ll see “Download in other formats” – just click on “Original Format” and you’ll be prompted to save a PHP file.
You can do it for any other files you’re missing.
July 26, 2007 at 2:43 am #2160Topic: TAG field in WordPress Plugin
in forum Pluginsmousehunter
MemberI would like to display the “tag” field in the widget, however, I’m not sure how to do it. I know where to put the code to make it display, but how do I actually get the value from the DB (which table/field). I thought $bbTopic might contain it, but i was wrong. Any help would be appreciated. Thanks.
July 26, 2007 at 12:25 am #53777In 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.txtfile.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
maxlengthproperty 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.29July 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?
-
AuthorSearch Results