May 4, 2011

PHP code on Feed Syndicator | 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_TopicIcon
PHP code on Feed Syndicator
Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 (0 votes) 
March 7, 2018
10:17 am
Avatar
brunobihari
Member
Members
Forum Posts: 8
Member Since:
February 28, 2018
sp_UserOfflineSmall Offline

Im trying to remove the class "td-visible-desktop" from this feed full text extraction: Login to see this link

The code that im using is:

$post[‘post_content’] = preg_replace('/<div class\=[\"]td-visible-desktop[\"]\>(.*?)<\/div>/is', '',$post[‘post_content’]);

also tried:

$post[‘post_content’] = preg_replace('/<div class\\=[\\"]td-visible-desktop[\\"]\\>(.*?)<\\/div>/is', '',$post[‘post_content’]);

No good so far. Can you give me a clue?

March 7, 2018
11:59 am
Avatar
CyberSEO
Admin
Forum Posts: 3913
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

A clue is Login to see this link

Please don't consider it as a joke or something like that, but regular expressions is the only thing that you can use in that particular case. The CyberSEO plugin allows to use any PHP code and the regular expressions of course. If you can't write it by yourself, you can order it from any PHP coder, including me.

P.S. Your code won't work because... it won't (I don't even understand it).

March 8, 2018
10:01 am
Avatar
brunobihari
Member
Members
Forum Posts: 8
Member Since:
February 28, 2018
sp_UserOfflineSmall Offline

Just to give leave my solution if someone else needs it.

$post['post_content'] = preg_replace('/<div class="td-visible-phone">.*?<\/div>/is', '', $post['post_content']);
$post['post_content'] = preg_replace('/<div class="td-visible-desktop">.*?<\/div>/is', '', $post['post_content']);
$post['post_content'] = preg_replace('/<div class="td-a-rec.*?<\/div>/is', '', $post['post_content']);

May 22, 2018
2:17 am
Avatar
Erenbur
Member
Members
Forum Posts: 30
Member Since:
May 30, 2017
sp_UserOfflineSmall Offline

Кавычки забыл:

 

$post['post_content'] = preg_replace('/<div class="td-visible-desktop">.*?<\/div>/is', "", $post['post_content']);

June 7, 2018
11:45 pm
Avatar
Erenbur
Member
Members
Forum Posts: 30
Member Since:
May 30, 2017
sp_UserOfflineSmall Offline

Извиняюсь, ступил, там две одинарных :)

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 541

Currently Online:
13 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