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

edited July 2006 in Vanilla 1.0 Help
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

Comments

  • MarkMark Vanilla Staff
    You can do whatever you want with the icons and pictures if you make a custom theme. There are some simple theming instructions on that troubleshooting tab up above. You can get the contents of a discussion with a query from your database and use your own code to render it however you want.
  • 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?
    You could use my extension "Account Pictures" to display bigger icons, but I haven't tested it with big icons like 150x150. It might mess up the comment. I'm working on a theme where icons are displayed next to the comment instead of above.
    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.?
    You can use the RSS2 or Atom feed
  • edited July 2006
    Hi,

    "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>
  • i didnt particularly fancy using an rss feed. no particular reason. well if my site takes off, ill get the web design monkey to do it for me :P when will there be a proper emoticons program? cos ive got the one that changes words to other things, but it just seems a lot of work just for emoticons. and the other extension doesnt support words
  • Check out Jazzman's excellent Vanillacons extension. http://lussumo.com/addons/?PostBackAction=AddOn&AddOnID=26 I have it on my website...eg: http://www.love2escape.com/chat/discussion/34/oh-lord-stuck-in-lodi-again/
  • right, ive just moved server, and account pictures is struggling. whenver it uploads, the files are always Chmod 000, so they dont display. how do i change it so that they will display?
  • krush, many thanks! I have used your code.......works really well.....i have it showing my 'Latest Chat Posts' at the top of my right hand column at: http://www.love2escape.com/multitrackers/ Wondering though how I can limit the number of characters in each post that it brings up?
  • edited July 2006
    I love the forum php code, but can't get it to include on my site (sadly, I still use blogger) Any tips? Could I do it with js and if so how? Cheers
  • right, ive just moved server, and account pictures is struggling. whenver it uploads, the files are always Chmod 000, so they dont display. how do i change it so that they will display?
  • edited July 2006
    Have a look in your FTP clients documentation about how to CHMOD. It's probably as simple as right clicking on the files and selecting 'CHMOD' or 'Permissions', then you change the value to 777 :)
  • yeah, i can do that, but its not a good idea if i have a lot of people uploading pictures. on my old server, from the upload they had the proper permissions.
  • can someone help?
  • edited July 2006
    You can try* editing default.php in the Account Picture extension directory:
    Add line 35AddConfigurationSetting($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
This discussion has been closed.