Hi guys,
After updating my small site to Osclasspoint, i see that links in the body of the ads open to the same window and that means the visitor is out of the site. I don't want that.
Also i have a custom url field and the same issue with that.
Previously i had done some modifications i found here for some file and also for the editor. But the instructions for the editor are not the same or i miss something.
Any ideas if they work for Osclasspoint 8.1 version? Maybe i have to ask to their forums?
I would appreciate some help if you can....
Thanks
Hi.
First in "oc-includes/osclass/helpers/hitems.php" find (around line 1519) find
if($value!='') { if(stripos($value,'http://')!==false || stripos($value,'https://')!==false) { return '<a href="'.osc_esc_html(html_entity_decode($value, ENT_COMPAT, "UTF-8")).'" >'.osc_esc_html(html_entity_decode($value, ENT_COMPAT, "UTF-8")).'</a>'; } else { return '<a href="http://'.osc_esc_html(html_entity_decode($value, ENT_COMPAT, "UTF-8")).'" >'.osc_esc_html(html_entity_decode($value, ENT_COMPAT, "UTF-8")).'</a>'; } } else { return ''; }
and change it to
if($value!='') { if(stripos($value,'http://')!==false || stripos($value,'https://')!==false) { return '<a href="'.osc_esc_html(html_entity_decode($value, ENT_COMPAT, "UTF-8")).' "target="_blank" >'.osc_esc_html(html_entity_decode($value, ENT_COMPAT, "UTF-8")).'</a>'; } else { return '<a href="http://'.osc_esc_html(html_entity_decode($value, ENT_COMPAT, "UTF-8")).' "target="_blank" >'.osc_esc_html(html_entity_decode($value, ENT_COMPAT, "UTF-8")).'</a>'; } } else { return ''; }
This will fix the custom field url.
If you need also the above to be "nofollow", check this example:
And here is described what you must change for the editor body links:
https://www.valueweb.gr/forums/osclass/how-to-make-links-in-a-post-to-open-in-new-window/
In "oc-includes/osclass/functions.php" find
function osc_tinymce_item_script()
and before the line
plugins : [
add
extended_valid_elements : "a[href|target=_blank|rel=nofollow]",
Let me know if this works for you and good luck.
I do not understand why ALL DEVELOPERS AVOID to make those changes. No website owner wants the visitors to LEAVE the site.
Keep in mind that the editor body links in ads posted without the change, will NOT open now in a new window.
This works for the new ones or the old ones before you updated to Osclasspoint.
While the extra url field, the change works for old/new urls. No problem.
Guys thank you SO MUCH.