Title: $ai_code error
Last modified: September 11, 2017

---

# $ai_code error

 *  Resolved [tinodo](https://wordpress.org/support/users/tinodo/)
 * (@tinodo)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/ai_code-error/)
 * I don’t know why but when I use normal ads inserted in the post, it shows error:
 * $ai_code = unserialize (base64_decode (‘YTo0OntpOjA7czoyNTY6IjxkaXYgY2xhc3M9ImFmdGVycG9zdCIgPiAgICANCiAgPGltZyBzcmM9Ii93cC1jb250ZW50L3VwbG9hZHMvMjAxNy8wOC9saWVuLWhlLWRhdC1zYWNoLXRpbm9yZWFkaW5ncm9vbS5qcGciIGFsdD0iTGnDqm4gaOG7hyDEkeG6t3Qgc8OhY2ggdOG6oWkgVGlubyBSZWFkaW5nIFJvb20iIC8
   +DQogIDxhIGhyZWY9Ii9saWVuLWhlLyI+PGJ1dHRvbiBjbGFzcz0iYWZ0ZXJwb3N0LWJ1dHRvbiI+
   xJDhurd0IHPDoWNoPC9idXR0b24+PC9hPg0KPC9kaXY+DQoiO2k6MTtzOjI2MDoiDQo8ZGl2IGNsYXNzPSJhZnRlcnBvc3QiID4gICAgDQogIDxpbWcgc3JjPSIvd3AtY29udGVudC91cGxvYWRzLzIwMTcvMDgvbGllbi1oZS1kYXQtc2FjaC10aW5vcmVhZGluZ3Jvb20tMi5qcGciIGFsdD0iTGnDqm4gaOG7hyDEkeG6t3Qgc8OhY2ggdOG6oWkgVGlubyBSZWFkaW5nIFJvb20iIC8
   +DQogIDxhIGhyZWY9Ii9saWVuLWhlLyI+PGJ1dHRvbiBjbGFzcz0iYWZ0ZXJwb3N0LWJ1dHRvbiI+
   xJDhurd0IHPDoWNoPC9idXR0b24+PC9hPg0KPC9kaXY+DQoiO2k6MjtzOjI2MDoiDQo8ZGl2IGNsYXNzPSJhZnRlcnBvc3QiID4gICAgDQogIDxpbWcgc3JjPSIvd3AtY29udGVudC91cGxvYWRzLzIwMTcvMDgvbGllbi1oZS1kYXQtc2FjaC10aW5vcmVhZGluZ3Jvb20tMy5qcGciIGFsdD0iTGnDqm4gaOG7hyDEkeG6t3Qgc8OhY2ggdOG6oWkgVGlubyBSZWFkaW5nIFJvb20iIC8
   +DQogIDxhIGhyZWY9Ii9saWVuLWhlLyI+PGJ1dHRvbiBjbGFzcz0iYWZ0ZXJwb3N0LWJ1dHRvbiI+
   xJDhurd0IHPDoWNoPC9idXR0b24+PC9hPg0KPC9kaXY+DQoiO2k6MztzOjI1ODoiDQo8ZGl2IGNsYXNzPSJhZnRlcnBvc3QiID4gICAgDQogIDxpbWcgc3JjPSIvd3AtY29udGVudC91cGxvYWRzLzIwMTcvMDgvbGllbi1oZS1kYXQtc2FjaC10aW5vcmVhZGluZ3Jvb20tNC5qcGciIGFsdD0iTGnDqm4gaOG7hyDEkeG6t3Qgc8OhY2ggdOG6oWkgVGlubyBSZWFkaW5nIFJvb20iIC8
   +DQogIDxhIGhyZWY9Ii9saWVuLWhlLyI+PGJ1dHRvbiBjbGFzcz0iYWZ0ZXJwb3N0LWJ1dHRvbiI+
   xJDhurd0IHPDoWNoPC9idXR0b24+PC9hPg0KPC9kaXY+Ijt9’)); $ai_index = mt_rand (1, 
   count ($ai_code)); $ai_code = $ai_code [$ai_index – 1]; $ai_enabled = true; if(
   $ai_enabled) echo str_replace (‘[#AI_DATA#]’, base64_encode (“[2,$ai_index]”),
   unserialize (base64_decode (‘czo4NDoiPGRpdiBjbGFzcz0nY29kZS1ibG9jayBjb2RlLWJsb2NrLTInIHN0eWxlPSdtYXJnaW46IDhweCBhdXRvOyB0ZXh0LWFsaWduOiBjZW50ZXI7Jz4KIjs
   =’))), $ai_code, unserialize (base64_decode (‘czo3OiI8L2Rpdj4KIjs=’));
 * and the normal code is:
    <div class=”afterpost” > <img src=”URL1″ alt=”” [<button class=”afterpost-button”>Đặt sách</button>](https://wordpress.org/lien-he/?output_format=md)
   </div> |rotate| <div class=”afterpost” > <img src=”URL2″ alt=”” [<button class=”afterpost-button”>Đặt sách</button>](https://wordpress.org/lien-he/?output_format=md)
   </div> |rotate| <div class=”afterpost” > <img src=”URL3″ alt=”” [<button class=”afterpost-button”>Đặt sách</button>](https://wordpress.org/lien-he/?output_format=md)
   </div> |rotate| <div class=”afterpost” > <img src=”URL4″ alt=”” [<button class=”afterpost-button”>Đặt sách</button>](https://wordpress.org/lien-he/?output_format=md)
   </div>
 * That’s it, it’s used to work, but suddenly one day it doesn’t anymore. the only
   thing I changed this week was the nameserver moving the domain to new host and
   that’s it. I don’t if this error specifically represents any things else. Please
   help me!
    The “URL1234” and close tags above are just an example since this frame
   is html supported so it’d turn crazy after submitting. I put actual image urls
   and decent close tags all in those so don’t worry.
    -  This topic was modified 8 years, 9 months ago by [tinodo](https://wordpress.org/support/users/tinodo/).
    -  This topic was modified 8 years, 9 months ago by [tinodo](https://wordpress.org/support/users/tinodo/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fai_code-error%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/ai_code-error/#post-9487192)
 * Sorry for late reply – I got notice of this thread only now – it seems some issue
   with this forum.
 * This looks like the code that should be executed by the W3 Total Cache plugin
   when you set Dynamic blocks to Server side using W3 Total Cache.
 * Make sure W3 Total Cache plugin is enabled / the cache is flushed.

Viewing 1 replies (of 1 total)

The topic ‘$ai_code error’ is closed to new replies.

 * ![](https://ps.w.org/ad-inserter/assets/icon-256x256.jpg?rev=1502039)
 * [Ad Inserter - Ad Manager & AdSense Ads](https://wordpress.org/plugins/ad-inserter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ad-inserter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ad-inserter/)
 * [Active Topics](https://wordpress.org/support/plugin/ad-inserter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ad-inserter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ad-inserter/reviews/)

## Tags

 * [rotate](https://wordpress.org/support/topic-tag/rotate/)

 * 1 reply
 * 2 participants
 * Last reply from: [Spacetime](https://wordpress.org/support/users/spacetime/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/ai_code-error/#post-9487192)
 * Status: resolved