Robkk
Forum Replies Created
-
no problem
hey Matthew can you post the full code to the solution whenever your close to the code to your plugin ??
creating functions confuses the eff out of me :(.
i seriously dont know how to use string replace to edit this
function gtf_get_mark_topic_read_link( $topic_id = 0 ) {
if ( !bbp_is_single_topic() ) {
return;
}$topic_id = bbp_get_topic_id( $topic_id );
$url = admin_url(‘admin-ajax.php’);
$content = “
<span id=’gtf-mark-topic-read’>
<span id=’gtf-mark-topic-read-{$topic_id}’>
<a href='#' rel='nofollow'>Mark Topic Read</a><—change to Mark Read
</span>
| <—delete this
</span>
<script type=’text/javascript’>
jQuery(‘#gtf-mark-topic-read-link’).click( function(e) {
e.preventDefault();
var data = {
action: ‘mark_topic_read’,
topic_id: jQuery(this).data(‘topic’)
};
jQuery.post(‘{$url}’, data, function(response) {
jQuery(‘#gtf-mark-topic-read-{$topic_id}’).html(response);
});
});
</script>
“;return apply_filters( ‘gtf_get_mark_topic_read_link’, $content, $topic_id );
}function gtf_update_topic_last_read_meta( $user_id, $topic_id ) {
$last_reply_id = bbp_get_topic_last_reply_id( $topic_id );
$last_read_id = get_user_meta( $user_id, ‘gtf-last-read-‘ . $topic_id, true );
if ( empty( $last_read_id ) ) {
return add_user_meta( $user_id, ‘gtf-last-read-‘ . $topic_id, $last_reply_id, true );
} else if ( $last_read_id < $last_reply_id ) {
return update_user_meta( $user_id, ‘gtf-last-read-‘ . $topic_id, $last_reply_id );
} else {
return “Already Read”; <— change to Marked Read
}
}str_replace() is just blowing my mind , i read alot from the link you gave me and it made it kind of worse 🙁
2nd function should be this??
function my_mark_topic_read() { $topic_id = intval($_POST['topic_id']); $user_id = get_current_user_id(); $result = gtf_update_topic_last_read_meta( $user_id, $topic_id ); if ($result === true) die("Marked as Read"); else if ($result === false) die("Failed to Update"); else die($result); }matthew im glad that you have an answer to this :D, but i have no idea how to create the function haha
Forum: Plugins
In reply to: [bbPress - Report Content] does moving the report button still work ??thanks for the help!!! 😀
I will eventually add template tags for this into the plugin
sounds good!!
Forum: Plugins
In reply to: [bbPress - Report Content] does moving the report button still work ??yep thats the one
i havent modified the gist
i just dont know how to echo the link right like how im doing it
should i just do this??
<?php echo get_topic_report_link(); ?>Forum: Plugins
In reply to: [bbPress Go To First Unread Post] custom placement of gtfup link??ok cool i was just checking
and great!!! thanks for the explantion!!
Forum: Plugins
In reply to: [bbPress Go To First Unread Post] custom placement of gtfup link??Then simply define
function my_function( $link, $topic_id, $last_read_id ) { }so if i use $topic_id it would go to the unread topic (topic author post)
would it show up on any unread topics??and i use $last_read_id if would just go to the last read post
would this show up only on read topics? not all topics?what does $link do?
and can i use them all ??
Forum: Plugins
In reply to: [bbPress Go To First Unread Post] custom placement of gtfup link??hey thanks for the support
i placed this in my functions.php in my child theme
remove_action( 'bbp_theme_after_topic_title', 'gtf_unread_post_link' );without the _get and it seemed to work
and placed this in my loop-single-topic.php
<?php echo gtf_get_unread_post_link( $topic_id ); ?>is this a correct way of doing all this??
never mind i just found out
use display:none to hide the original css
and .post to display it only on forum pages
like this
code to hide on blog posts
li.bbp-header { display: none; }code to display only on forums
.post li.bbp-header { background: none repeat scroll 0% 0% transparent; display:block; }you could also use this on other things like li.bbp footer, or certain links
Forum: Plugins
In reply to: [Simple Share Buttons Adder] woocommerce displaysimple share buttons has a shortcode to use
add shortcode [ssba] in short description
add shortcode [ssba_hide] in product description
This should work exactly how you wanted
Forum: Plugins
In reply to: [WooCommerce] How to Remove lost password link to woocommerce account@davidsless i solved my own solution
just use a redirection plugin
whatever url the lost password link redirects you ,use the redirect plugin to redirect that url you dont want, to something like this yoursite.com/login/?action=lostpassword