SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast SirJonathan's Avatar
    Join Date
    Jan 2005
    Location
    Travelin' throughout the USA
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Syntax Question - Modding vBulletin, small change

    Hey guys! I'm in a TINY bit over my head here, but I'm very very close and I'm not giving up!

    I'm modifying a vBulletin script that takes a form and posts the data from it into a new thread on the forum. I'm making a slight modification where instead of using a default title, I am changing the post title to actually be the QUESTION that the user asks through the form. So, my variable for the answer is:

    $posttitlepower

    (creative, I know)..

    Here's the ORIGINAL code:

    Code:
    ('".addslashes(htmlspecialchars($bbuserinfo[username]))." $posttitlepower', " . TIMENOW . ", $formforumid,
                                             1, 0, '" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid],
                                             '" . addslashes($bbuserinfo['username']) . "', " . TIMENOW . ", 0, 1,
                                             0)
                            ");
    Now.. what I want to do is remove the whole username deal at the beginning and ONLY insert $posttitlepower - Well.. I tried that and then I encountered the problem with using ' and ' in the post. My test answer, "What's your name?".. Gives a mySQL error. SO, I see that they solved that with the htmlspecialchars thing.. so clever little me tries to go:

    ".addslashes(htmlspecialchars($posttitlepower)." .. and as soon as I do THAT, I get a parse error.. unexpected ";" on line 251.. which, is the last line I'm showing in the code snippet above.

    Now, that leads me to believe that I have the right idea here, I'm simply not doing the syntax correctly.

    Any ideas guys?

    All help is very greatly appreciated .

    -Jonathan
    :: Sabramedia :: Project Manager/Marketing Director

    :: WordPress Consulting :: A few hours each week.

  2. #2
    SitePoint Enthusiast SirJonathan's Avatar
    Join Date
    Jan 2005
    Location
    Travelin' throughout the USA
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Solved ! !
    :: Sabramedia :: Project Manager/Marketing Director

    :: WordPress Consulting :: A few hours each week.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •