Hi, im very new to osclass but not to PHP, im familure with PHP. However using the plugins manually and customising them is a little difficult depending on the plugin itself.
i know how to manually place a plugin at specific locations thats fine , but in this case i do tis abut then the origonal " Send Message " Button is still being displayed
I am hoping maybe somebody who is familure with the online Chat Plugin would be ableto to help me..
I would prefer to actually just move ther origonal and have it displayed at another location, but just adding the if exists call within another div, just results in 2 buttons being displayed and the new button doesnt actually do anything
here is how i am placing the Button where i need on the item page... And also the FUNCTION.PHP for the Online chat button ( Make )
i would like to know how do i remove the origonal button.
thanks in advance for any replies
WHERE I AM ADDING THE BUTTON
<h2>
<?php _e('', 'delta'); ?>
<?php if(osc_item_user_id() > 0) { ?>
<a href="#about" class="hbtn"><?php _e('Contact', 'delta'); ?></a>
<span><?php if(function_exists('oc_chat_button')) { echo oc_chat_button(); } ?></span>
<?php } ?>
</h2>
THIS IS THE MAKE BUTTON FUNCTION.PHP FOR ONLINE MESSAGES PLUGIN
function oc_chat_button( $user_id = '' ) {
$html = '';
$user_name = '';
if((osc_is_ad_page() || osc_is_search_page()) && $user_id == '') {
$user_id = osc_item_user_id();
$user_name = osc_item_contact_name();
}
if($user_id <> '' && $user_id > 0) {
$registered = 1;
$last_active = ModelOC::newInstance()->getUserLastActive($user_id);
$active_limit = osc_get_preference('refresh_user', 'plugin-online_chat');
$active_limit = ($active_limit > 0 ? $active_limit : 120);
$active_limit = $active_limit + 10;
$limit_datetime = date('Y-m-d H:i:s', strtotime(' -' . $active_limit . ' seconds', time()));
} else {
$registered = 0;
}
if($registered == 1 && $user_id <> osc_logged_user_id() && !oc_check_bans($user_id)) {
$class = ' oc-active';
} else {
$class = ' oc-disabled';
}
if(isset($limit_datetime) && $limit_datetime <> '' && $last_active >= $limit_datetime) {
$class .= ' oc-online';
} else {
$class .= ' oc-offline';
}
$html .= '<a href="#" class="oc-chat-button' . $class . '" data-to-user-id="' . $user_id . '" data-to-user-name="' . osc_esc_html($user_name) . '" data-to-user-image="' . oc_get_picture( $user_id ) . '">';
$html .= '<div class="oc-user-left"><i class="fa fa-comments-o"></i></div>';
$html .= '<div class="oc-user-right">';
if($registered == 0) {
$html .= '<div class="oc-user-top">' . __('Chat unavailable', 'online_chat') . '</div>';
$html .= '<div class="oc-user-bot">' . __('User is not registered', 'online_chat') . '</div>';
} else {
if($user_id == osc_logged_user_id()) {
$html .= '<div class="oc-user-top">' . __('Chat unavailable', 'online_chat') . '</div>';
$html .= '<div class="oc-user-bot">' . __('It is your listing', 'online_chat') . '</div>';
} else if (oc_check_bans($user_id)) {
$html .= '<div class="oc-user-top">' . __('Chat unavailable', 'online_chat') . '</div>';
$html .= '<div class="oc-user-bot">' . __('User has blocked you', 'online_chat') . '</div>';
} else {
$html .= '<div class="oc-user-top oc-status-offline">' . __('Send a Message', 'online_chat') . '</div>';
$html .= '<div class="oc-user-bot oc-status-offline">' . __('User is offline', 'online_chat') . '</div>';
$html .= '<div class="oc-user-top oc-status-online">' . __('Start chatting', 'online_chat') . '</div>';
$html .= '<div class="oc-user-bot oc-status-online">' . __('User is online', 'online_chat') . '</div>';
}
}
$html .= '</div>';
$html .= '</a>';
return $html;
}
My question again is. How do i Manually Locate the Button whilst removing the origonal thats located in the hook