Osclass Support Forums

Osclass plugin support => Instant Messenger Plugin => Topic started by: MB Themes on July 07, 2016, 10:44:10 AM

Title: Unregistered users
Post by: MB Themes on July 07, 2016, 10:44:10 AM
Hello guys,
Today there has been update to 1.0.3 version that allows messaging to unregistered users as well without need to register.
Check and leave feedback ;)

// Note that you need to uninstall and install plugin again.
Title: Re: Unregistered users
Post by: BabyDunk on August 22, 2016, 01:08:44 PM
i am having trouble with unregistered user message taking over the threads from other users.

i had done test message for an item 2 weeks ago and now a message has been sent by a real user but this users message have been merged with the test message i had been sending. i was using a logged in user for the test but the real user is not logged in

here is a screenshot of the thread (https://s10.postimg.org/jemtu9wkp/merged_user_mkessgae.png)

the test messengers name has changed the real users name. but the phone number stayed the same for the test message.

i have noticed similar behaviour with other test messages.

how does the plugin organgise the threads? by email or ip and item?


i also have trouble with removing threads . when i remove threads they do seem to be removed from within the admin panel but when a message gets sent the old threads reappear with in that new message thread :-\

Title: Re: Unregistered users
Post by: BabyDunk on August 22, 2016, 01:12:13 PM
the only modification i have made to the plugin is on line 185 of the index.php

i changed this
Code: [Select]
$to_user_name = $item['s_contact_name'];

to this
Code: [Select]
$to_user_name = osc_username_now();

and that function looks like this
Code: [Select]
<?php
// Display UserName
    
function osc_username_now(){
        if( 
osc_item_user_id() <> && osc_item_user_id() <> '') {
        
$user User::newInstance()->findByPrimaryKeyosc_item_user_id() );
        return 
$user['s_username'];
    } else {
        return 
false;
    }
}
?>



Title: Re: Unregistered users
Post by: BabyDunk on August 22, 2016, 01:15:09 PM
oooh and i made a change in how the contact name is got in my theme.

with this
Code: [Select]
<?php
// Child Class for Contact::Form
class myContactForm extends ContactForm {

    static public function 
your_username() {
        if( 
Session::newInstance()->_getForm("yourName") != "" ) {
            
$name Session::newInstance()->_getForm("yourName");
            
parent::generic_input_text("yourName"$namenullfalse);
        } else {
            
parent::generic_input_text("yourName"BO_username_commentator_now(), nullfalse);
        }
        return 
true;
    }
}
?>


and the function used here is this
Code: [Select]
<?php
// Display Commentator UserName
    
function BO_username_commentator_now(){
        if( 
osc_logged_user_id()  <> && osc_logged_user_id()  <> '') {
        
$user User::newInstance()->findByPrimaryKeyosc_logged_user_id()  );
        return 
$user['s_username'];
    } else {
        return 
false;
    }
}
?>

Title: Re: Unregistered users
Post by: MB Themes on August 22, 2016, 01:21:51 PM
@BabyDunk
For phone number, it will not change as it is placed inside message. There is no function that would get it from user profile.
Title: Re: Unregistered users
Post by: BabyDunk on August 22, 2016, 01:27:33 PM
here is a thread from 2 diffrerent items and 2 different users being merged (https://s13.postimg.org/mf2rkuo3r/here_is_a_thread_from_another_item_merged_with_t.png)
Title: Re: Unregistered users
Post by: MB Themes on August 22, 2016, 01:29:23 PM
@BabyDunk
Can you do this on our demo site?
Title: Re: Unregistered users
Post by: BabyDunk on August 22, 2016, 01:30:00 PM
i will give it a go and see if i can .
Title: Re: Unregistered users
Post by: BabyDunk on August 22, 2016, 01:40:46 PM
i cant try it on your system . spam protect plugin bans me everytime i send a message.
Title: Re: Unregistered users
Post by: MB Themes on August 22, 2016, 01:47:53 PM
@BabyDunk
What are you doing? :D
I have disabled it for while.
Title: Re: Unregistered users
Post by: BabyDunk on August 22, 2016, 01:54:45 PM
im gonna try and get the same result as i receive on my system :D lol

i havent received my activation email for registration. can you activate me please :D
Title: Re: Unregistered users
Post by: MB Themes on August 22, 2016, 01:56:43 PM
@BabyDunk
Done.
Title: Re: Unregistered users
Post by: BabyDunk on August 22, 2016, 02:03:22 PM
thanks :D  need listing activated now thanks
Title: Re: Unregistered users
Post by: MB Themes on August 22, 2016, 02:11:56 PM
Done
Title: Re: Unregistered users
Post by: BabyDunk on August 22, 2016, 02:14:35 PM
can you activate a second account please :D

Title: Re: Unregistered users
Post by: BabyDunk on August 22, 2016, 02:16:18 PM
sorry one sec

going register with an email address i have already used in one of the messages
Title: Re: Unregistered users
Post by: BabyDunk on August 22, 2016, 02:24:46 PM
can you remove the messages now please :D
Title: Re: Unregistered users
Post by: BabyDunk on August 22, 2016, 05:03:23 PM
hi frosticek

i dont know if you have removed the messages yet . i was using -1 in the maintenance tab . maybe that is what is  causing my problem, although it did remove all messages from the conversations tab
Title: Re: Unregistered users
Post by: MB Themes on August 23, 2016, 10:20:51 AM
@BabyDunk
I did not remove anything, were you able to get the issue?
Title: Re: Unregistered users
Post by: BabyDunk on August 23, 2016, 11:10:34 AM
Good morning Frosticek :D

no i didn't get the issue. i only seen the problem on my system after i removed the threads but i don't know if removing the threads with -1 days caused the problem. as i see in the plugin help notes,that only inactive threads are removed.

how long does a thread need to be inactive for before its considered for removal?

I cant test any further without the threads being removed :-\

time for coffee ;-)
Title: Re: Unregistered users
Post by: MB Themes on August 23, 2016, 11:28:25 AM
@BabyDunk
You can set this in Maintenance menu of plugin.
Title: Re: Unregistered users
Post by: BabyDunk on August 23, 2016, 12:41:47 PM
sorry i didnt realise i could change that myself.

i cant get the same effect as what i was having. i have since removed and reinstall the plugin on my server and made only that one change on the line185 in index.php.

i could have possibly made more changed when i first looked for what i need to change for to display username when i first installed the plugin.

i will just have to wait and see what happens from here on out :)

just to clarify, it is safe to remove threads by using -1 days ??

Many thanks
Chris
Title: Re: Unregistered users
Post by: MB Themes on August 23, 2016, 01:34:07 PM
@BabyDunk
It is better to set it to i.e. 9999 days.
Title: Re: Unregistered users
Post by: Bokas on November 06, 2016, 07:57:33 PM
Hello,can anyone tell me how to turn off unregistered users to send messages and this blue button to be shown only when someone is loged in.Tnx
Title: Re: Unregistered users
Post by: MB Themes on November 06, 2016, 08:04:01 PM
@Bokas
Place code for button into:
Code: [Select]
<?php if(osc_is_web_user_logged_in()) { ?>
   ... code for button ...
<?php ?>
Title: Re: Unregistered users
Post by: Bokas on November 06, 2016, 08:12:52 PM
Thanks for quick reply!
Title: Re: Unregistered users
Post by: bimbo on December 17, 2016, 02:42:50 PM
Hello guys,
Today there has been update to 1.0.3 version that allows messaging to unregistered users as well without need to register.
Check and leave feedback ;)

// Note that you need to uninstall and install plugin again.

Really not a good idea unregistered users should not be able to contact registered users as tons of spam will be in your message box
Title: Re: Unregistered users
Post by: bimbo on December 17, 2016, 02:44:25 PM
@Bokas
Place code for button into:
Code: [Select]
<?php if(osc_is_web_user_logged_in()) { ?>
   ... code for button ...
<?php ?>

How to do please and where?
Title: Re: Unregistered users
Post by: MB Themes on December 17, 2016, 05:57:49 PM
@bimbo
How to? Copy & paste
Where? Anywhere you want to have buttons.


Simply using this code you can show send message button just to users that are currently logged in.
Title: Re: Unregistered users
Post by: bimbo on December 17, 2016, 07:32:36 PM
@bimbo
How to? Copy & paste
Where? Anywhere you want to have buttons.


Simply using this code you can show send message button just to users that are currently logged in.

Just look at these pics,i have plugin installed ok i can see the button and so can unregistered users

http://imgur.com/CYqHTfx

http://imgur.com/iK4mvfc
Title: Re: Unregistered users
Post by: MB Themes on December 17, 2016, 08:04:12 PM
@bimbo
Can you please read again what is written in plugin configuration?
Where you found something that unregistered users cannot send personal message?
Title: Re: Unregistered users
Post by: bimbo on December 17, 2016, 09:05:19 PM
@bimbo
Can you please read again what is written in plugin configuration?
Where you found something that unregistered users cannot send personal message?

ok got the <?php if(function_exists('im_messages')) { echo im_messages(); } ?> in header,also logged out can still see button and send message..

Quote
Where you found something that unregistered users cannot send personal message?

I want that unregistered users cannot send personal message until registered or logged in! I also have Show Header Link to Registered Only On! But still unregistered can still send messages

Here is site you can still see button no matter what i do?

http://www.freeclassifieds.trade
Title: Re: Unregistered users
Post by: MB Themes on December 17, 2016, 11:29:41 PM
@bimbo
I do not see any button related to plugin.
Title: Re: Unregistered users
Post by: bimbo on December 18, 2016, 12:34:57 AM
@bimbo
I do not see any button related to plugin.

This is the plugin right encircled??

http://imgur.com/DgTtJb8
Title: Re: Unregistered users
Post by: MB Themes on December 18, 2016, 10:09:46 AM
@bimbo
as you have written in this thread, modification of original code:
Code: [Select]
<?php if(function_exists('im_messages')) { echo im_messages(); } ?>
into:
Code: [Select]
<?php 
  
if(function_exists('im_messages')) { 
    if(
osc_is_web_user_logged_in(){
      echo 
im_messages(); 
    } 
  } 
?>


Will hide it to not-logged users.
Button you have higlighted is different function.
Title: Re: Unregistered users
Post by: bimbo on December 18, 2016, 02:20:01 PM
@bimbo
as you have written in this thread, modification of original code:
Code: [Select]
<?php if(function_exists('im_messages')) { echo im_messages(); } ?>
into:
Code: [Select]
<?php 
  
if(function_exists('im_messages')) { 
    if(
osc_is_web_user_logged_in(){
      echo 
im_messages(); 
    } 
  } 
?>


Will hide it to not-logged users.
Button you have higlighted is different function.

The above code made site go blank
Title: Re: Unregistered users
Post by: MB Themes on December 18, 2016, 05:23:21 PM
@bimbo
Right, there is missing one )

Fixed:
Code: [Select]
<?php 
  
if(function_exists('im_messages')) { 
    if(
osc_is_web_user_logged_in()){
      echo 
im_messages(); 
    } 
  } 
?>

Title: Re: Unregistered users
Post by: bimbo on December 18, 2016, 07:24:28 PM
@bimbo
Right, there is missing one )

Fixed:
Code: [Select]
<?php 
  
if(function_exists('im_messages')) { 
    if(
osc_is_web_user_logged_in()){
      echo 
im_messages(); 
    } 
  } 
?>


Ok site didn't go blank but unregistered members can still send private messages
Title: Re: Unregistered users
Post by: MB Themes on December 18, 2016, 09:41:19 PM
@bimbo
This code only hide send message button, respectively header link button. There is no code to deny sending messages to users that are not logged in.
Title: Re: Unregistered users
Post by: bimbo on December 20, 2016, 02:58:31 PM
Quote
There is no code to deny sending messages to users that are not logged in.

Can you do a code for that please so deny users that are not logged it to send messages,this is essential as any kind of spam source can be sent to members!!

Regards
Title: Re: Unregistered users
Post by: MB Themes on December 20, 2016, 10:45:53 PM
I already post solution.
Title: Re: Unregistered users
Post by: bimbo on December 20, 2016, 11:14:37 PM
I already post solution.

where is this code located in zara theme? <?php if(function_exists('im_messages')) { echo im_messages(); } ?>

Found it but it still will not work

How to hide send message button it's important to unregistered users?
Title: Re: Unregistered users
Post by: MB Themes on December 21, 2016, 08:42:45 AM
@bimbo
Following code shows Send Message button to everyone. It is also in plugin configuration:
Code: [Select]
<?php 
  
if(function_exists('im_contact_button')) { 
    
im_contact_button(); 
  } 
?>


Following code hide this button to users that are not logged in:
Code: [Select]
<?php 
  
if(function_exists('im_contact_button')) { 
    if(
osc_is_web_user_logged_in()) {
      
im_contact_button(); 
    }
  } 
?>

Title: Re: Unregistered users
Post by: bimbo on December 21, 2016, 11:07:25 AM
@bimbo
Following code shows Send Message button to everyone. It is also in plugin configuration:
Code: [Select]
<?php 
  
if(function_exists('im_contact_button')) { 
    
im_contact_button(); 
  } 
?>


Following code hide this button to users that are not logged in:
Code: [Select]
<?php 
  
if(function_exists('im_contact_button')) { 
    if(
osc_is_web_user_logged_in()) {
      
im_contact_button(); 
    }
  } 
?>


Could you just say where to find above code in which file?,would be a lot easier!

Code: [Select]
<?php 
  
if(function_exists('im_contact_button')) { 
    
im_contact_button(); 
  } 
?>
Title: Re: Unregistered users
Post by: MB Themes on December 21, 2016, 09:32:34 PM
First read instructions of plugin, on each page in configuration at bottom. Check also integration section.
Title: Re: Unregistered users
Post by: bimbo on December 22, 2016, 12:26:34 AM
First read instructions of plugin, on each page in configuration at bottom. Check also integration section.

Listen this is support forum i am not getting answers and this is the 4th page in the thread can you just not say where that code has to be executed

e.g oc-content/blah??

i mean it's simple just give me a straight answer!!  >:(

If you are not able just say so end of story!!
Title: Re: Unregistered users
Post by: MB Themes on December 22, 2016, 09:19:56 AM
@bimbo
You are asking 4th time and still did not read plugin setup instructions.... so sad...

Quote
To show link to message center and count of unread messages of user, place following link to your theme files:
<?php if(function_exists('im_messages')) { echo im_messages(); } ?>
  To show "Send message" button, place following link to your theme files (item.php, search-list.php, ...):
<?php if(function_exists('im_contact_button')) { im_contact_button(); } ?>
Title: Re: Unregistered users
Post by: bimbo on December 22, 2016, 12:55:24 PM
@bimbo
You are asking 4th time and still did not read plugin setup instructions.... so sad...

Quote
To show link to message center and count of unread messages of user, place following link to your theme files:
<?php if(function_exists('im_messages')) { echo im_messages(); } ?>
  To show "Send message" button, place following link to your theme files (item.php, search-list.php, ...):
<?php if(function_exists('im_contact_button')) { im_contact_button(); } ?>

i don't think you understand if i put this in

Code: [Select]
<?php if(function_exists('im_contact_button')) { im_contact_button(); } ?>
it shows button twice????

Actually ya know what,i'm asking paypal for my money back due to lack of proper support
Title: Re: Unregistered users
Post by: MB Themes on December 22, 2016, 01:40:23 PM
@bimbo
And still you just complaint and cannot read what is in plugin configuration:

Hook Button to Item Page
"Send Message" button will be shown on listing page without need of theme modifications.


For sure you have turned this on ... or ... you have already placed link into your files
Then you place link again and complain that it is shown twice.

If you are smart person, first you will go trough plugin configuration, read all instructions here and then you will ask something.


What are you going to complain on paypal? We have delivered product that exactly match it's description and is fully funcitonal.
Where you found functionality "hide to unregistered"? So it is your custom requirement? Yes it is.. then if you are not satisfied what you got for free, you can hire developer to setup your page.

Locking this thread as original question was already answered.