May 4, 2011

executing php for post re-edit | 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
executing php for post re-edit
Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 (0 votes) 
September 12, 2017
3:08 pm
Avatar
s.popadiin@gmail.com
Member
Members
Forum Posts: 32
Member Since:
May 11, 2017
sp_UserOfflineSmall Offline

Hello,

Can not get php code to change syndicated posts.

My first example

I try to use modification tools and paste only php code.
This is my code:
$post['post_content'] = preg_replace('/我们来阻止广告! (为什么?)/', '', $post['post_content']);

This is my post in plain text after syndication (The code to be removed is in the last line):
<img class=”aligncenter size-large wp-image-67224″ src=”http://cdn.osxdaily.com/wp-content/uploads/2017/09/iphone-x-6-610×442.jpg” sizes=”(max-width: 610px) 100vw, 610px” srcset=”http://cdn.osxdaily.com/wp-content/uploads/2017/09/iphone-x-6-610×442.jpg 610w, Login to see this link 900w” alt=”iPhone X” width=”610″ height=”442″ />
苹果公司已经宣布推出全新的iPhone X,发音为iPhone 10. iPhone X具有各种独特的功能和功能,并被视为iPhone的未来。
<!– Quick Adsense WordPress Plugin: Login to see this link –><span id=”more-67214″></span>iPhone X配备了一个重新设计的外壳,前面和后面都有不锈钢侧面和玻璃,以及一个更大的屏幕,几乎覆盖了iPhone的整个前脸。通过以这种方式增加显示尺寸,iPhone X会丢失熟悉的主页按钮和触摸ID功能,而是获得一个新的面部ID功能,可以扫描您的脸部以解锁iPhone X.
是的,如果你想知道,iPhone X是一个完全独立的设备,也刚刚宣布的iPhone 8和iPhone 8 Plus 。与iPhone 8和iPhone 8 Plus不同,iPhone X仅适用于具有5.8“显示屏的单一物理尺寸。<h3>iPhone X规格及特点</h3><ul>  <li>5.8“超级Retina HDR True Tone显示屏,分辨率为2436 x 1125,分辨率为458 PPI</li>  <li>Face ID解锁机制取代Touch ID和Home Button</li>  <li>具有双光学防抖功能的12 MP双摄像头</li>  <li>A11仿生CPU,提高性能</li>  <li>前置摄像头上的人像模式,前后摄像头的人像照明</li>  <li>银色和空白灰色选项,全玻璃前后,不锈钢边</li>  <li>防水防尘</li>  <li>电池说比iPhone 7持续了2个小时</li>  <li>支持通过玻璃后面的无线充电,可以让您用充电器充电iPhone,而无需将任何东西插入闪电端口,因为可选的AirPower充电垫</li>  <li>未经证实,但据报有3GB RAM</li></ul><img class=”aligncenter size-large wp-image-67220″ src=”http://cdn.osxdaily.com/wp-content/uploads/2017/09/iphone-x-4-610×523.jpg” sizes=”(max-width: 610px) 100vw, 610px” srcset=”http://cdn.osxdaily.com/wp-content/uploads/2017/09/iphone-x-4-610×523.jpg 610w, Login to see this link 900w” alt=”iPhone X” width=”610″ height=”523″ />
主页按钮的缺少是iOS设备的首选,而不是按主屏幕按钮查看主屏幕,您将使用滑动向上的手势。这意味着您通常用于访问控制中心的滑动手势已被重新调整到主屏幕,而是从iPhone X屏幕顶部向下滑动以访问控制中心。由于手势是基于软件的,所以随着时间的推移,这些手势总是会发生变化的。如前所述,Touch ID已被Face ID取代,Face ID使用iPhone X前置摄像头通过查看您的手机并识别您的脸部来解锁设备。
<img class=”aligncenter size-large wp-image-67218″ src=”http://cdn.osxdaily.com/wp-content/uploads/2017/09/iphone-x-3-610×289.jpg” sizes=”(max-width: 610px) 100vw, 610px” srcset=”http://cdn.osxdaily.com/wp-content/uploads/2017/09/iphone-x-3-610×289.jpg 610w, Login to see this link 900w” alt=”iPhone X” width=”610″ height=”289″ />
一个可选的AirPower充电垫将在2018年可用,并允许使用Qi充电插头少量充电,类似于Apple Watch的充电。这有时被称为“无线”充电,但请记住,垫子仍然用电线插入墙壁。
<img class=”aligncenter size-large wp-image-67216″ src=”http://cdn.osxdaily.com/wp-content/uploads/2017/09/wireless-charging-iphone-x-610×463.jpg” sizes=”(max-width: 610px) 100vw, 610px” srcset=”http://cdn.osxdaily.com/wp-content/uploads/2017/09/wireless-charging-iphone-x-610×463.jpg 610w, Login to see this link 900w” alt=”充电无线iPhone X” width=”610″ height=”463″ /><h3>iPhone X定价起价为999美元</h3>iPhone X的尺寸为64GB和256GB,价格为999美元。
较大的256GB iPhone X型号将售价为1150美元。
<iframe src=”https://www.youtube.com/embed/mW6hFttt_KE” width=”560″ height=”315″ frameborder=”0″ allowfullscreen=”allowfullscreen”> [嵌入式内容] </iframe><h3>iPhone X预订从10月27日,11月3日发布日期开始</h3>对于有兴趣预订iPhone X的用户,您可以在10月27日进行。
iPhone X将于11月3日发布之日起在商店内发售。
<iframe src=”https://www.youtube.com/embed/wmEqgjT61FA” width=”560″ height=”315″ frameborder=”0″ allowfullscreen=”allowfullscreen”> [嵌入式内容] </iframe>
另外苹果已经宣布苹果手表系列3和苹果电视4K ,以及iPhone 8和iPhone 8 Plus 。
<img class=”aligncenter size-large wp-image-67230″ src=”http://cdn.osxdaily.com/wp-content/uploads/2017/09/iphone-x-and-iphone-8-610×630.jpg” sizes=”(max-width: 610px) 100vw, 610px” srcset=”http://cdn.osxdaily.com/wp-content/uploads/2017/09/iphone-x-and-iphone-8-610×630.jpg 610w, Login to see this link 1294w” alt=”iPhone X和iPhone 8 Plus旁边的iPhone X” width=”610″ height=”630″ />
(iPhone X和iPhone 8 Plus旁边显示iPhone X)
<strong>我们来阻止广告!</strong> (为什么?)

 

This is the result – an error:

Post Modification Tools

Modifying existing posts. Please wait…
Fatal error: Cannot use object of type stdClass as array in /home/…./wp-content/plugins/cyberseo/cyberseo.php(52) : eval()’d code(3) : runtime-created function on line 1
September 12, 2017
3:19 pm
Avatar
s.popadiin@gmail.com
Member
Members
Forum Posts: 32
Member Since:
May 11, 2017
sp_UserOfflineSmall Offline

Another example:

This is my code:
$post['post_content'] = preg_replace('/Информация за контакти/', '', $post['post_content']);

This is my post content:

<img src=”http://products.bg/wp-content/uploads/2017/09/d0bfd180d0b5d181d0b0-d0b7d0b0-d0bad0bed181d0b0-finlux-fhs-3660.jpg” /><img src=”http://products.bg/wp-content/uploads/2017/09/d0bfd180d0b5d181d0b0-d0b7d0b0-d0bad0bed181d0b0-finlux-fhs-3660.jpg” />
&nbsp;
Цена: 39.90 лв.
Преса за коса Finlux FHS-3660 Публикувано в категория Маша за коса Произведено от Finlux Публикувано от CloudCart Store RSS Feed
Информация за контакти<ul style=”list-style: none; padding-left: 0;”>  <li>Търговска Верига Зора</li>  <li>ул.Чепинско шосе 15</li>  <li>София</li>  <li>1225</li>  <li>BG</li></ul>&nbsp;

 

This is the result – an error:

Modifying existing posts. Please wait…
Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /var/www/public_html/Products/wp-content/plugins/cyberseo/cyberseo.php(52) : eval()’d code(3) : runtime-created function:1 Stack trace: #0 /var/www/public_html/Products/wp-content/plugins/cyberseo/cyberseo.php(52) : eval()’d code(3): __lambda_func(Object(stdClass)) #1 /var/www/public_html/Products/wp-includes/class-wp-hook.php(298): cseo_tools_menu(”) #2 /var/www/public_html/Products/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(”, Array) #3 /var/www/public_html/Products/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #4 /var/www/public_html/Products/wp-admin/admin.php(222): do_action(‘cyberseo_page_c…’) #5 {main} thrown in /var/www/public_html/Products/wp-content/plugins/cyberseo/cyberseo.php(52) : eval()’d code(3) : runtime-created function on line 1

 

If I try to use the same code during syndication, nothing is replace and no error is thrown.

September 13, 2017
5:03 am
Avatar
CyberSEO
Admin
Forum Posts: 3676
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

That single line of PHP code is correct. There must be some other custom code which causes the error.

September 13, 2017
3:20 pm
Avatar
s.popadiin@gmail.com
Member
Members
Forum Posts: 32
Member Since:
May 11, 2017
sp_UserOfflineSmall Offline

No other modifiers. And if used via modification tools on existing posts other modifiers should not matter.

Should I send access to you so you could check?

September 14, 2017
8:58 am
Avatar
CyberSEO
Admin
Forum Posts: 3676
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Yes, please send it to my email.

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 541

Currently Online:
7 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

ninja321: 84

s.baryshev.aoasp: 64

Freedom: 61

MediFormatica: 49

B8europe: 47

saviulisse67: 45

Member Stats:

Guest Posters: 338

Members: 2636

Moderators: 0

Admins: 1

Forum Stats:

Groups: 1

Forums: 5

Topics: 1535

Posts: 7754

Newest Members:

kevin.crywolf, kevin.cooper.boonenewsmedia, florian.stickel, t.schleiser, worldnetsites, janodamek

Administrators: CyberSEO: 3676