May 4, 2011

Remove last image | CyberSEO Pro | Support Forum

Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Related Related Topics sp_TopicIcon
Remove last image
Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 (0 votes) 
June 29, 2017
3:53 am
Avatar
s.popadiin@gmail.com
Member
Members
Forum Posts: 32
Member Since:
May 11, 2017
sp_UserOfflineSmall Offline

Hello,

I managed to start CyberSEO and it is working like a charm. A lot of extras what makes it very flexible. I really like it.

In the beginning it was not fetching full text because after the install it has put wrong URL to full-text script. Just saying if anybody has the same problem. Check the URL in your settings to fix this. 

Anyways now I would like to ask a small favor.

I would like to remove last image from the RSS posts. Usually It is an image of an author or a logo.

So, please could you give me the PHP code for..

1. removing last image

or

2. removing image with size under 10k

10x and all the best.

June 29, 2017
4:11 am
Avatar
CyberSEO
Admin
Forum Posts: 3913
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

I think it's not a good approach to do as suggested above. The proper way would be to delete some exact pattern of HTML code. For example, the author logo image may have some special formatting (HTML tags), styles, div parameters etc. So the PHP snippet can find it and cut from the post's body. Please post your feed's URL or email it to Login to see this link

June 29, 2017
4:21 am
Avatar
s.popadiin@gmail.com
Member
Members
Forum Posts: 32
Member Since:
May 11, 2017
sp_UserOfflineSmall Offline

Yes, you are right. This is bad approach.

Can we delete a whole div section. For example everything inside 

<div class="about-author row hidden-xs">

.....sf-punk

</div>

June 29, 2017
4:59 am
Avatar
CyberSEO
Admin
Forum Posts: 3913
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Sure. E.g.:

Login to see the code

You should read about Login to see this link.

June 29, 2017
12:07 pm
Avatar
s.popadiin@gmail.com
Member
Members
Forum Posts: 32
Member Since:
May 11, 2017
sp_UserOfflineSmall Offline

Thanks admin!

I can read some php and know a bit regexp. I tested your code and wrote my regex. Non of them work.

This is my version I tested with

$post['post_content'] = preg_replace('/<div class="about-author row hidden-xs">([\s\S]*?<\/div>){7}/s', '', $post['post_content']);
$post['post_excerpt'] = preg_replace('/<div class="about-author row hidden-xs">([\s\S]*?<\/div>){7}/s', '', $post['post_excerpt']);

If I take original post page html and paste it into regex checker with this regex expression the unnecessary html is matched.

Why is not removed. I dont know.

June 29, 2017
12:16 pm
Avatar
CyberSEO
Admin
Forum Posts: 3913
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

I tested your code and wrote my regex. Non of them work.
...
Why is not removed. I dont know.  

Only in case if your actual RSS feed has a different HTML structure. I didn't see the feed, so I can't answer your question.

June 29, 2017
4:03 pm
Avatar
s.popadiin@gmail.com
Member
Members
Forum Posts: 32
Member Since:
May 11, 2017
sp_UserOfflineSmall Offline

I am trying to send you email to Login to see this link, but it is not delivering. What email do you use?

June 30, 2017
5:24 am
Avatar
CyberSEO
Admin
Forum Posts: 3913
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

admin said
I think it's not a good approach to do as suggested above. The proper way would be to delete some exact pattern of HTML code. For example, the author logo image may have some special formatting (HTML tags), styles, div parameters etc. So the PHP snippet can find it and cut from the post's body. Please post your feed's URL or email it to Login to see this link  

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 541

Currently Online:
22 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

ninja321: 84

s.baryshev.aoasp: 68

Freedom: 61

Pandermos: 54

MediFormatica: 49

B8europe: 48

Member Stats:

Guest Posters: 337

Members: 2817

Moderators: 0

Admins: 1

Forum Stats:

Groups: 1

Forums: 5

Topics: 1627

Posts: 8280

Newest Members:

igor.buzaev, jeremyboucher, lthompson2709, MAC, duty3canada, backlinkmorocco

Administrators: CyberSEO: 3913