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.
Integrating Vanilla into Normal Webpages
Hey,
I'm currently working on a site and I'm looking to add Vanilla into the pages, but so far all I've found is a way to get the login session to be active on the main site.
I'm currently looking for areas that contain all the html formatting for everything, but so far I haven't found anything.
So does anyone know where all the html formatting of everything happens? Currently I'm looking for the people.php pages (part with the person's profile info and the Wall add-on)
My final goal is to have the main page have a news section which will have discussions I've marked with "BlogThis" add-on, Discussion page with the main part of Vanilla integrated into it, and a profile page which would have the same info as the People.php page.
The main site's design though is a little to different to integrate into Vanilla, so I figured I would integrate Vanilla's aspects with the main site.
But in order to do that I need to find the main files where formatting is done. And then also the pages with functions on it. (Like where is "$Page->FireEvents();" defined/what does it do?)
If anyone could help, that would be great!
0
This discussion has been closed.
Comments
include_once('path/to/vanilla/appg/settings.php'); include_once('path/to/vanilla/conf/settings.php'); $sql="SELECT * FROM LUM_Discussion WHERE Active='1' AND Sink='0' ORDER BY DateLastActive DESC LIMIT 5"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { $DiscussionID = $row['DiscussionID']; $Name = $row['Name']; $CountComments = $row['CountComments']; $PageWork = floor($CountComments / $Configuration['COMMENTS_PER_PAGE']); if ($PageWork > 0) { $Page = "&page=".$PageWork; } else { $Page = ""; } echo '<a href="/path/to/vanilla/comments.php?DiscussionID='.$DiscussionID.$Page.'">'.$Name.'</a><br />'; }
That's just a quick idea anyway, I don't know how familiar you are with code. Let me know if it looks like nonsense.So to hide the tabs and heading for example you would replace lines 25 to 35 of themes/menu.php with
$inframe = $_GET['inframe']; if (empty($inframe)) { echo '<div id="Header"> <h1> '.$this->Context->Configuration['BANNER_TITLE'].' </h1> <ul>'; while (list($Key, $Tab) = each($this->Tabs)) { echo '<li'.$this->TabClass($this->CurrentTab, $Tab['Value']).'><a href="'.$Tab['Url'].'" '.$Tab['Attributes'].'>'.$Tab['Text'].'</a></li>'; } echo '</ul> </div>'; }
so when you put the URL in the frame code just append inframe=yes to the end.
<?php // Note: This file is included from the library/Framework/Framework.Control.Head.php class. $HeadString = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="'.$this->Context->GetDefinition('XMLLang').'"> <head> <title>'.$this->Context->Configuration['APPLICATION_TITLE'].' - '.$this->Context->PageTitle.'</title> <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" />'; while (list($Name, $Content) = each($this->Meta)) { $HeadString .= ' <meta name="'.$Name.'" content="'.$Content.'" />'; } if (is_array($this->StyleSheets)) { while (list($Key, $StyleSheet) = each($this->StyleSheets)) { $HeadString .= ' <link rel="stylesheet" type="text/css" href="'.$StyleSheet['Sheet'].'"'.($StyleSheet['Media'] == ''?'':' media="'.$StyleSheet['Media'].'"').' />'; } } if (is_array($this->Scripts)) { $ScriptCount = count($this->Scripts); $i = 0; for ($i = 0; $i < $ScriptCount; $i++) { $HeadString .= ' <script type="text/javascript" src="'.$this->Scripts[$i].'"></script>'; } } if (is_array($this->Strings)) { $StringCount = count($this->Strings); $i = 0; for ($i = 0; $i < $StringCount; $i++) { $HeadString .= $this->Strings[$i]; } } $BodyId = ""; if ($this->BodyId != "") $BodyId = ' id="'.$this->BodyId.'"'; echo $HeadString; if (isset($_GET['inframe'])) { echo '<style type="text/css"> #Panel { display:none; } </style>'; } echo '</head> <body'.$BodyId.' '.$this->Context->BodyAttributes.'> <div id="SiteContainer">'; ?>
for example