Support Forum
Dear simple:press team,
since i've come to rely on your excellent and quick support; i'd like to do two feature requests - basically i'm fathoming if these are technically possible.
First, would there be any way to show images in posts only to registered users? Either by removing them completely when checking the thread in a guest role or by replacing them with a standardized "please register to view" - image?
Second - do you see any possibility to downsize the preview of images in the TinyMCE-window? Our forums are pretty image-heavy; and this is one of the recurring complaints.
much obliged as always and best regards,
Ben
On the first question then there is no permission built in for this. But I will open a ticket this end so we can discuss it's merits and see if we should include it.
it could be achieved using a filter to parse the post content before display and massage it accordingly. If your php is up for that I can tell you where to construct it...
On the second question I am afraid I know of no way. It is a pain for us as well. But I will do a search to see if there is anything out there that might help. It has been a long while since I last looked into it.
YELLOW
SWORDFISH
|
Hallo Andy,
and thanks for the quick reply - you guys never cease to amaze me in this regard! Good news regarding the first answer; and pretty much as expected concerning the Tiny-MCE preview sizes. Judging from my complete lack of ideas how to implement this; i had hoped you might pull something out of your bottomless bag of tricks . So, no problem; we'll have to live with that.
My PHP-skills are taking shape; so if it isn't too much trouble i'd very much like to see that idea content filter idea.
best regards and many thanks,
Ben
Well the first thing to say is that SP filters are exactly the same as WP filters and used in the same way. So if you are unsure about them then you can read up all about them on the WP codex. They are VERY easy to use.
The filter in SP you would need is called 'sph_display_post_content_pre_filter'. This passes in the $content variable and at the end of the filter you need to return the $content massaged appropriately.
But the other thing you need is information about the current user so you will need to decide what data to use as a test on whether you need to parse the content and change it or not.
Globalise the variable $spThisUser. This will ALWAYS return a data object pertaining to the current user making the request. To see what data is available in $spThisUser go to the forum admin > Toolbox > Data Inspector and turn on the option to display it. Next time you run a forum page you will see the available data.
So you should end up with something like:
add_filter('sph_display_post_content_pre_filter', 'my_parse_function'); function my_parse_function($content) { global $spThisUser; if($spThisUser->XXXXX == YYYYY) { $content = ZZZZZ; } return $content; }
where XXXXX is the data item you need to check against YYYYY and ZZZZZ is the operation you want to perrorm on the $content - probably some regex to strip images.
Some notes: This will only effect display. It will not change the content of saved data. The spFunctions.php file in the SP theme templates folder is the best place for this. As always we recommend that you create your own SP theme so that any customisation is not lost during a future update. (http://codex.simple-press.com/.....g-a-theme/)
YELLOW
SWORDFISH
|
1 Guest(s)