Notifications
Clear all

[Solved] Bulk Sync Exposed Photo In Protected Post Member Only Access!

24 Posts
3 Users
4 Reactions
3,208 Views
Posts: 89
Customer
Topic starter
(@itesla)
Member
Joined: 8 years ago

Hello

I have just renew my license and would like to have something easy done.

I have decided to sync my old posts to Forums topics in this way i hope crawlers will index them, my main problem is that my WP posts most have no text in them but an image.

So when i do bulk Sync it exposes the image no mater what settings.

I think the solution would be to add Cross-Posting Custom Content from the Settings page so it adds a text in every topic that will be synchronized.

"To View This Member Only Content, Joyn Us!"

Topic Tags
23 Replies
Posts: 89
Customer
Topic starter
(@itesla)
Member
Joined: 8 years ago

Also now i try add Custom Content in a WP Post, it updated but if i try to remove it does not remove back.

Reply
Posts: 89
Customer
Topic starter
(@itesla)
Member
Joined: 8 years ago

Hello

It seems i was wrong, now tested more.

If i select in settings Excerpt then it Sync posts that only have some text, and the image is not displayed which is very good, but posts with only image in them will not be synchronized at all!

When i set in settings Custom then it will display the image, i did not try on important posts, but i feel is the same as Full Content option.

Still would be good to add my idea to add custom content to bulk posts from the settings, in short the add-on needs more versatility functions in controlling the content that will be displayed.

So for the moment i m satisfied up to 70% if you have anything to add would be glad to listen to devs opinions.

Thank you.

Reply
2 Replies
Elvina
(@elvina)
Joined: 5 years ago

Support
Posts: 1403

@itesla,

I've just asked our developers about it and currently, I'm waiting for the response from them. I'll update the topic asap.

Reply
Customer
(@itesla)
Joined: 8 years ago

Member
Posts: 89

@elvina
Additionally.

About selecting (Blog Category / Term 🙂 box.

When i select to sync a specific category to a specific forum, the WP category is not sorted only Forums are sorted proper, it sorts it by date but i would like to sort them by name, this is useful in case of many categories like in my case.

About Automatic Cross Posting

Second sorting is needed after the Auto Cross Posting Category and Forum was created, it would be good to sort them by same name not when first, second or third was created, in this way all of them will be organized.

If you can tell me what code and in which files must be changed, i m ready to change them, maybe devs don't plan to do this yet.

Thank you! {blackemo}:hotdrink:

Reply
Elvina
Posts: 1403
(@elvina)
Support
Joined: 5 years ago

@itesla,

Please use the following code to make it work.

add_filter('wpforo_content', function ($content){
return 'To View This Member Only Content, Joyn Us!';
});

The code should be added in the fin the active theme's functions.php file.

Reply
1 Reply
Customer
(@itesla)
Joined: 8 years ago

Member
Posts: 89

@elvina

Yes it works but it shows this for all topics, i want to set only for newer posts and expose some old posts content, this i do for SEO so search engines will index topics because they don't index protected posts.

Reply
Posts: 89
Customer
Topic starter
(@itesla)
Member
Joined: 8 years ago

o*g it replaces every topic and reply even if is not linked with WP posts. {green}:amazed:  

Reply
6 Replies
Elvina
(@elvina)
Joined: 5 years ago

Support
Posts: 1403

@itesla,

Please remove the code provided above and use the following one: 

add_filter('wpforo_content', function ($content, $post) {
if ((int) $post['is_first_post'] === 1) {
global $wpdb;
$sql = $wpdb->prepare("SELECT `post_id` FROM `{$wpdb->postmeta}` WHERE `meta_key` = %s AND `meta_value` = %s", '_wpforo_crossposting_topicid', $post['topicid']);
if ($postID = $wpdb->get_var($sql) && stripos($content, '<img') === 0) {
$content = 'To View This Member Only Content, Joyn Us!';
}
}
return $content;
}, 10, 2);
Reply
Customer
(@itesla)
Joined: 8 years ago

Member
Posts: 89

@elvina
Can you tell what the code does exactly?

Have added but no changes, do i need to do the Sync again?

My English is poor, that is why let me tell again what i want to achieve.

I have Forums which are free to view, and WP Posts which are protected and only member can access, but problem is Search Engines do not show Protected Posts in search results, so i decided to create in Forums a topic for each of this WP protected Posts, as a result crawlers will crawl Forum topics which will contain the button [Read More ] to the main WP protected post so if someone decide he will buy membership.

Need to make some old posts to sync to topics and show full content but for the new posts, to show excerpt without image from WP post which is working at the moment when set Settings > Excerpt, problem is some of this WP posts have only a image without any text and if i select in Add-On Settings > Excerpt, then i go an make Sync it does not create topics for this types of posts that contain only an image, that is why i need somehow to create custom text in bulk for such WP Posts. Currently the Add-on works if i edit each WP Post and add custom content but i have hundred of them and i don't want to edit them, it will take allot of time and also will show updated time for each post which is not needed in such case.

Thank you.

Reply
Elvina
(@elvina)
Joined: 5 years ago

Support
Posts: 1403

Hi @itesla,

Sorry for the late response.

Have added but no changes, do i need to do the Sync again?

Yes, you can do it again.

Please from the Settings use the "Full Content" option in the "Cross-posting Content" to make the code provided above work, and check again.
Also please note you can customize the code provided above and make it work as you need.

Reply
Customer
(@itesla)
Joined: 8 years ago

Member
Posts: 89

@elvina

Hello, no problem, i understand.

Can you tell me how to show full post for already converted topics?
I need to expose full topic for some old posts but if the code is removed it does not change anything.

I have try remove autoposting for each category and forum but adding it back and do the sync again with Full Content option, does not make it full content back, no changes.

And yes the code is good i get half of it but i not understand it all i know that img is set to 0 meaning it will return no image and my message.

Thanks for your time and patience.

Reply
Elvina
(@elvina)
Joined: 5 years ago

Support
Posts: 1403

@itesla,

We don't follow you well please try to explain in other words.

Reply
Customer
(@itesla)
Joined: 8 years ago

Member
Posts: 89

@elvina

I would like to show full post in some topics, i mean to re sync them so it will expose photos back.

Reply
Page 1 / 2
Share:
Scroll to top