amnesia623
02-24-2008, 08:12 PM
I have a system that pulls RSS feeds (new headlines) from multiple sources and stores them in the same database as vbulletin. I then have custom plugins that take those feed items and displays them on the site (can see at http://www.arizonanewstalk.com/city.php). I then want to display a link next to RSS item to start a new thread and autopopulate the subject line with the headline title.
I duplicated the newthread.php and newthread template and modified the newthread.php to show the newthread template. I am passing a the id of the RSS item from the page that displays the rss headlines to the new newthread.php file via get. I am using a plugin at the global_start hook (will move to newthread_start later) to get the item ID and pull the title to display in the title field of the new thread. I am using this code:
$headlineid = $_GET['headlineid'];
$titlequery = $db->query_first("SELECT ItemTitle FROM feedItems WHERE itemID = 1234 LIMIT 1");
while ($hdln = $db->fetch_array($titlequery))
{
$msgtitle = $hdln['ItemTitle'];
}
I then use this code in the new newthread template:
<input type="text" class="bginput" name="subject" value="$msgtitle" size="40" maxlength="$vboptions[titlemaxchars]" tabindex="1" />
The problem is that the subject field won't populate using the $msgtitle variable.
I am at a loss here because if I hard code $msgtitle = "this works" then it will autopopulate the field with "this works".
Anyone have any ideas? please help!
If you go to http://www.arizonanewstalk.com/city.php and click any "talk about this" link you can see what I'm trying to do (look at the URL variable for the item id too)
Thanks
I duplicated the newthread.php and newthread template and modified the newthread.php to show the newthread template. I am passing a the id of the RSS item from the page that displays the rss headlines to the new newthread.php file via get. I am using a plugin at the global_start hook (will move to newthread_start later) to get the item ID and pull the title to display in the title field of the new thread. I am using this code:
$headlineid = $_GET['headlineid'];
$titlequery = $db->query_first("SELECT ItemTitle FROM feedItems WHERE itemID = 1234 LIMIT 1");
while ($hdln = $db->fetch_array($titlequery))
{
$msgtitle = $hdln['ItemTitle'];
}
I then use this code in the new newthread template:
<input type="text" class="bginput" name="subject" value="$msgtitle" size="40" maxlength="$vboptions[titlemaxchars]" tabindex="1" />
The problem is that the subject field won't populate using the $msgtitle variable.
I am at a loss here because if I hard code $msgtitle = "this works" then it will autopopulate the field with "this works".
Anyone have any ideas? please help!
If you go to http://www.arizonanewstalk.com/city.php and click any "talk about this" link you can see what I'm trying to do (look at the URL variable for the item id too)
Thanks