Skip to main content
Recent Posts
21
Feature Discussion / Re: ElkArte as blog commnets?
Last post by badmonkey -
Would you consider just making the leap to straight forum? Everything described so far is a forum. Posted subject, and comments (replies). If you want emphasis on the original post, that could be accomplished with CSS styling. If you don't want others to have the ability to create a blog...er thread, simply revoke permissions accordingly. Elkarte software can already do everything you describe without interaction with any other platform. It can even be customized to include or hide info on said threads or posts.
22
Addons / Re: Multi Tenancy - Multi Forums Via Various Domains In A Single Installation
Last post by ahrasis -
Ok. The above modifications to bootstrap.php are kinda ugly, so I rewrote again.

This time I modified the following:
Code: [Select]
		else
{
require_once($settings_loc);
}
}

To this (which I think is cleaner, easier to read and comprehend):
Code: [Select]
		else
{
require_once($settings_loc);
}
$this->resetBoardUrl();
}

/**
* Reset $boardurl in Settings.php
*/
private function resetBoardUrl()
{
global $boardurl, $dboardurl, $dhost, $tboardurl, $thost;

// Default $boardurl and host
if (!empty(parse_url($boardurl, PHP_URL_PATH))
$dhost = parse_url($boardurl, PHP_URL_HOST) . parse_url($boardurl, PHP_URL_PATH);
else
$dhost = parse_url($boardurl, PHP_URL_HOST);
$dboardurl = $boardurl;

// Tenancy $boardurl and host
if (!empty(str_replace('/index.php', '', $_SERVER['SCRIPT_NAME'])))
$thost = $_SERVER['HTTP_HOST'] .  str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']);
else
$thost = $_SERVER['HTTP_HOST'];
$tboardurl = 'http' . (parse_url($boardurl, PHP_URL_SCHEME) === 'https' ? 's' : '') . '://' . $thost;

// Switch to tenancy $boardurl if default is not the same
if ($dboardurl != $tboardurl | $dhost != $thost)
$boardurl = $tboardurl;
}

This code does not need a settings file, so I am in dilemma whether to create it for each of the tenant or not. I can reuse the previous code in tenancy.admin.php and there tenancy.template.php can create the file upon adding a tenant.
23
Feature Discussion / Re: ElkArte as blog commnets?
Last post by pdp-7 -
So if I have a landingpage that looks like blog that is ElkArte forum somethingsomething and then I have my blog that I want to add commenting function and want to do that so those comments are threads in the forum ... how to merge these two?

Just like there are all those wp comments and disqus and what not. But I don't want to use those. I want those comments to be part of the forum content in form of threads.

Blog is made other means I don't need anything to do with it. Just comments section for the blog. Whole website is generated with Hugo and so is blog section also.

Or am I missing something in the translation here?
24
Addons / Re: Multi Tenancy - Multi Forums Via Various Domains In A Single Installation
Last post by ahrasis -
Regarding modifications in the bootstrap.php, basically I am thinking to replace the following code:
Code: [Select]
		// Where the Settings.php file is located
$settings_loc = __DIR__ . '/Settings.php';

With this:
Code: [Select]
		global $dboardurl, $dhost, $tboardurl, $thost;

// Get default $boardurl and $cookiename from default Settings.php
$ds_loc = __DIR__ . '/Settings.php';
$bu_ori = array();
$handle = @fopen($ds_loc, 'r');
if ($handle) {
while (!feof($handle)) {
$buffer = fgets($handle);
if(strpos($buffer, '$boardurl') !== FALSE)
$bu_ori[] = $buffer;
if(strpos($buffer, '$cookiename') !== FALSE)
$cn_ori[] = $buffer;
}
fclose($handle);
}
preg_match('#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#', $bu_ori[0], $bu_match);
$dboardurl = $bu_match[0];
$dhost = parse_url($dboardurl, PHP_URL_HOST) . (!empty(parse_url($dboardurl, PHP_URL_PATH)) ? parse_url($dboardurl, PHP_URL_PATH) : '');
preg_match("/(?:(?:\"(?:\\\\\"|[^\"])+\")|(?:'(?:\\\'|[^'])+'))/is", $cn_ori[0], $cn_match);
$dcookie = str_replace("'", '', $cn_match[0]);

// Now define tenancy host and boardurl
$thost = $_SERVER['HTTP_HOST'] . (!empty(str_replace('/index.php', '', $_SERVER['SCRIPT_NAME'])) ? str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) : '');
$tboardurl = parse_url($dboardurl, PHP_URL_SCHEME) . '://' . $thost;

// Where the Settings.php file is located
if ($dhost === $thost)
$settings_loc = $ds_loc;
else {
$settings_loc = __DIR__ . '/.tenancy/' . str_replace('/', '.', $thost) . '.php';
if (!file_exists($settings_loc)) {
copy($ds_loc, $settings_loc);
file_put_contents($settings_loc, str_replace($dhost, $thost, file_get_contents($settings_loc)));
file_put_contents($settings_loc, str_replace($dcookie, uniqid(), file_get_contents($settings_loc)));
}
}

This will basically check the default $boardurl and $cookiename in default Settings.php and create a new settings (copied from default) for each tenant in .tenancy folder with its own tenancy $boardurl and $cookiename.

Edited: I think this modification can be done via bootsrap.php extension like "class TenantBootstrap extend Bootstrap" something and then overwrite the whole "private function loadSettingsFile()" overriding with "public function bringUpBasics()" (since private cannot be overriden by child class or something like that) but I am not so sure on how to achieve that in ElkArte yet.

I think I might attend the later approach, later.
26
Feature Discussion / Re: ElkArte as blog commnets?
Last post by ahrasis -
I think you just need to make a copy of default theme and modify display.template.php to make it look like a blog.

You can also use Simple Portal to make your forum landing page look like a blog.

A long, long time ago in this forum software origin far, far away, there were mods that attempt to do that. However, be warned that you might be seduced into the dark side of the force while attempting to find them. :P
27
Support / Backup/Restore
Last post by mobiltal -
Something that should be simple is proving frustrating. I have an older version of ElkArte that I've backed up and want to restore into a refresh install of ElkArte on a different server. I have Googled everywhere... searched the forums here... and have found no instructions on how to do this. I would have thought a restore a fundamental feature of a forum. I found the backup and performed it, but how do you use it... particularly when the forum DB tables all have different names and the forum releases are quite different?

Any help would be greatly appreciated.
28
Feature Discussion / Re: ElkArte as blog commnets?
Last post by emanuele -
Hi @pdp-7 and welcome. :)

What I did in the past was create a board that was faking the forum, but instead reading blog posts and comments from a wordpress install and showing them as topics in the forum  (I don't remember if I went as far as to pair the users by email and link the "correct" forum profiles or not, but probably not).
TBH, this my solution has no big advantages, the only one was to give people on the forum a direct access to the content published on the blog.
At the time i also planned to have a "reply" box able to push directly to WP, but I never end up writing it.

I'm not sure if this is what you have in mind.
Another way to look at it that comes to my mind is to close the blog comments, create a topic with a link to the blog post and when posting on the blog and then let comment only on the forum.
And there are probably others.