MyBB Community Forums

Full Version: I got a error with my plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home2/hackinor/public_html/inc/plugins/AuthoritysFirstPlugin.php on line 10


These are lines 9 10 11 and 12..

"name" => Global_Announcement)
"description" => Add_to_posts)
"website" => www.mybb.com)
"author" => Authority)

Some other code around it..
<?php
if(!defined("IN_MYBB"))
{
 die("Direct initializtation of the file is not allowed.<br /> Please make sure IN_MYBB is defined.");
}
function myplugin_info()
{
return array(
"name" => Global_Announcement)
"description" => Add_to_posts)
"website" => www.mybb.com)
"author" => Authority)
?>
}
global $my_external_var;
function myFunction()
{
 global $db
 $new_var = $db->escape_string('<td class="thead"><strong> Hello Word</strong></td>');
}

function myFunction()
{
global $db, $message, $text;
$new_var = $db->escape_string($text);
$message ['message'] .= $new_var;
}


$post ['message'] .= <br /> Put the announment here";




Wow, I don't even know where to begin. The code is absolute nonsense and full of syntax errors. Literally.

Please don't attempt to fix it and instead read through all the guides I previously linked you to. Actually, don't even read those yet. You clearly don't know how PHP works, so please take a little time to learn it. It will be extremely hard to develop a plugin if you don't even know the basic PHP syntax.

http://php.net/manual/en/tutorial.php
http://www.tizag.com/phpT/index.php
http://www.w3schools.com/php/default.asp
Well the cold truth is better then telling me I did good. Thanks I guess I will try to learn php when I come home from school. I will spend a week or two on that then give it another shot.

(2011-09-07, 10:24 AM)faviouz Wrote: [ -> ]Wow, I don't even know where to begin. The code is absolute nonsense and full of syntax errors. Literally.

Please don't attempt to fix it and instead read through all the guides I previously linked you to. Actually, don't even read those yet. You clearly don't know how PHP works, so please take a little time to learn it. It will be extremely hard to develop a plugin if you don't even know the basic PHP syntax.

http://php.net/manual/en/tutorial.php
http://www.tizag.com/phpT/index.php
http://www.w3schools.com/php/default.asp

This is for your own good really. I could go through the various mistakes you made, but it's best if you learn it yourself and get an understanding of how PHP works first.