Skip to content

Instantly share code, notes, and snippets.

@imagehat
Created March 21, 2013 15:09
Show Gist options
  • Save imagehat/5213767 to your computer and use it in GitHub Desktop.
Save imagehat/5213767 to your computer and use it in GitHub Desktop.
EE forum module hack to add forum_id variable to exp:forum:topic_titles for linking to individual topics
In mod.forum_core.php around line 11003 find:
// Single Variables
foreach ($this->EE->TMPL->var_single as $key => $val)
{
// parse {post_total}
if ($key == 'post_total')
{
$tagdata = $this->EE->TMPL->swap_var_single($key, $row['thread_total'], $tagdata);
}
and change to:
// Single Variables
foreach ($this->EE->TMPL->var_single as $key => $val)
{
// @hack @mk added:
// parse {forum_id}
if ($key == 'forum_id')
{
$tagdata = $this->EE->TMPL->swap_var_single($key, $row['forum_id'], $tagdata);
}
// END @hack
// parse {post_total}
if ($key == 'post_total')
{
$tagdata = $this->EE->TMPL->swap_var_single($key, $row['thread_total'], $tagdata);
}
------
this allows something like this in the template:
{path=forums/viewforum/{forum_id}/}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment