vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=323055

Vb Api Extension returns data and shows always after <body>
by talhatc
19 Jul 2016 00:23

I am creating a Api Extension with the help of Wordpress Header & Footer Integation

I am almost done and everything seems to be in order except, whenever I return a data, it always goes on the top of the browser, after the <body> tag, example given below:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

header-forums.php file simply contains an echo statement. VB displays it, but shows it on the top, even above the main-navbar-wrapper. However, the weird part is, if I do the following, it shows where the hook is supposed to show it


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Any help would be highly appreciated.

Replicant 19 Jul 2016 01:11

The echo statement is the problem. VB wants to display the returned data. Assign your data to a variable and return the variable.

$data = '<h1>My Custom Footer</h1>';
return $data;

talhatc 19 Jul 2016 10:12

Quote:

Originally Posted by Replicant (Post 2573417)
The echo statement is the problem. VB wants to display the returned data. Assign your data to a variable and return the variable.

$data = '<h1>My Custom Footer</h1>';
return $data;

Well the issue isn't with the second piece of code from my post, outputting the following is causing the issue


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Replicant 19 Jul 2016 13:03

Using an echo will show at the top of the page like a debug marker. You need to remove the echo.

in your snippet, you're doing "return;"

You need to put the data in a variable and "return $data;"


All times are GMT. The time now is 07:56.

Powered by vBulletin® Version 3.8.14
Copyright © 2022, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.