Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
My questions, and stuff
Firstly, gotta say, i love this forum. its not got loads of features, but it does the job. its not too big and complicated and it looks fab.
Now onto the questions.
Can i change it so that instead of havin the account icons in the posts, i have the account pictures? And can i change the size of these, to 150x150 or something reasonable?
Secondly, is there a way to grab a thread, to display it on an external page? Id quite like to use the vanilla background to power the news part of my site.
Thanks
0
This discussion has been closed.
Comments
"Secondly, is there a way to grab a thread, to display it on an external page? Id quite like to use the vanilla background to power the news part of my site."
Just link to your forums RSS feed in the code below, save that as a .php file and use a PHP include, that should show the last 10 posts.
<i><strong>Vanilla Forum Feed</strong> <?php set_time_limit(0); $file = "http://rssfeedgoeshere"; $TOTALITEM_WANTED=5; //any number of links $rss_channel = array(); $currently_writing = ""; $main = ""; $item_counter = 0; function startElement($parser, $name, $attrs) { global $rss_channel, $currently_writing, $main; switch($name) { case "RSS": case "RDF:RDF": case "ITEMS": $currently_writing = ""; break; case "CHANNEL": $main = "CHANNEL"; break; case "IMAGE": $main = "IMAGE"; $rss_channel["IMAGE"] = array(); break; case "ITEM": $main = "ITEMS"; break; default: $currently_writing = $name; break; } } function endElement($parser, $name) { global $rss_channel, $currently_writing, $item_counter; $currently_writing = ""; if ($name == "ITEM") { $item_counter++; } } function characterData($parser, $data) { global $rss_channel, $currently_writing, $main, $item_counter; if ($currently_writing != "") { switch($main) { case "CHANNEL": if (isset($rss_channel[$currently_writing])) { $rss_channel[$currently_writing] .= $data; } else { $rss_channel[$currently_writing] = $data; } break; case "IMAGE": if (isset($rss_channel[$main][$currently_writing])) { $rss_channel[$main][$currently_writing] .= $data; } else { $rss_channel[$main][$currently_writing] = $data; } break; case "ITEMS": if (isset($rss_channel[$main][$item_counter][$currently_writing])) { $rss_channel[$main][$item_counter][$currently_writing] .= $data; } else { $rss_channel[$main][$item_counter][$currently_writing] = $data; } break; } } } $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); if (!($fp = fopen($file, "r"))) { die("could not open XML input"); } while ($data = fread($fp, 4096)) { if (!xml_parse($xml_parser, $data, feof($fp))) { die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); } } xml_parser_free($xml_parser); // output HTML if (isset($rss_channel["ITEMS"])) { if (count($rss_channel["ITEMS"]) > 0) { for($i = 0;$i < $TOTALITEM_WANTED;$i++) { if (isset($rss_channel["ITEMS"][$i]["LINK"])) { print ("\n<div class=\"itemtitle\"><a href=\"" . $rss_channel["ITEMS"][$i]["LINK"] . "\">" . $rss_channel["ITEMS"][$i]["TITLE"] . "</a></div>"); } else { print ("\n<div class=\"itemtitle\">" . $rss_channel["ITEMS"][$i]["TITLE"] . "</div>"); } print ("<div class=\"itemdescription\">" . $rss_channel["ITEMS"][$i]["DESCRIPTION"] . "</div>"); } } else { print ("<b>There are no articles in this feed.</b>"); } } ?></i>
Add line 35
AddConfigurationSetting($Context, 'ACCOUNTPICTURES_CHMOD', '0644');
Change line 122
return $Uploader->Upload($InputName, $this->UploadPath, md5($InputName . $UserID) .'.'. strtolower($FileExtension), '0', '1');
for
$return = $Uploader->Upload($InputName, $this->UploadPath, md5($InputName . $UserID) .'.'. strtolower($FileExtension), '0', '1'); if ($this->Context->WarningCollector->Count() == 0) chmod($return, octdec($this->Context->Configuration['ACCOUNTPICTURES_CHMOD']) );
Edit Configuration['ACCOUNTPICTURES_CHMOD'] in conf/setting.php for the setting needed.
*I havn't tested it myself