Parse error
Permalink
So I tried to create a custom class to pull the most recent version author name from a page, since everything else I was trying was just returning the name of the previous version's author. I placed the file in the models folder and used a loader to call it up. But I'm getting a parse error in the file.
I should note that I am not a coder by any stretch of the imagination, and this custom class is my first attempt at writing any kind of PHP ever. And the parse error didn't provide any helpful information... just said "parse error in line 24."
Here's the code:
So, how far off am I, c5ers?
I should note that I am not a coder by any stretch of the imagination, and this custom class is my first attempt at writing any kind of PHP ever. And the parse error didn't provide any helpful information... just said "parse error in line 24."
Here's the code:
class CustomTest extends Object { function getNewVersionAuthorName($page) { $db = Loader::db(); $cID = $page->getCollectionID(); $cvID = $page->getVersionObject()->getVersionID(); $q = "select cvAuthorUID from CollectionVersions where cID = '$cID' and cvID = '$cvID' and cvIsNew = 1"; $uID = $db->GetOne($q); $q1 = "select uName from Users where uID = '$uID'"; $username = $db->GetOne($q1); return $username } }
So, how far off am I, c5ers?