template question: category name/id and topic name in post.tmpl? [message #160569] |
Wed, 30 September 2009 03:37 |
|
qubodup
Messages: 24 Registered: February 2008
Karma: 0
|
Junior Member |
|
|
Hello,
I'm working on a template, in which I would like to have a "breadcrumb" on (nearly) every page, including the "post a reply" page, where I want to see the index, category, forum and thread title (which I reply to) in a breadcrumb.
However, it appears that I cannot put my hands on the "message title", "category title" and "category id" variables, as $frm is defined without these variables in src/post.php.t .
Am I correct? Or do I actually have access to these variables and just didn't notice?
Is there a way to get these variables from a theme file (inside a {FUNC: } maybe)?
If there is no way, I would of course recommend these variables to be included in $frm in a future version of post.php.t of course
|
|
|
|
Re: template question: category name/id and topic name in post.tmpl? [message #160579 is a reply to message #160578] |
Thu, 01 October 2009 14:00 |
|
naudefj
Messages: 3771 Registered: December 2004
Karma: 28
|
Senior Member Administrator Core Developer |
|
|
Here is a patch:
Index: src/post.php.t
===================================================================
RCS file: /forum21/install/forum_data/src/post.php.t,v
retrieving revision 1.161
diff -u -a -r1.161 post.php.t
--- src/post.php.t 29 Jan 2009 18:37:17 -0000 1.161
+++ src/post.php.t 1 Oct 2009 13:59:28 -0000
@@ -58,7 +58,7 @@
} else {
std_error('systemerr');
}
- $frm = db_sab('SELECT id, name, max_attach_size, forum_opt, max_file_attachments, post_passwd, message_threshold FROM {SQL_TABLE_PREFIX}forum WHERE id='.$frm_id);
+ $frm = db_sab('SELECT id, cat_id, name, max_attach_size, forum_opt, max_file_attachments, post_passwd, message_threshold FROM {SQL_TABLE_PREFIX}forum WHERE id='.$frm_id);
if (!$frm) {
std_error('systemerr');
}
Index: thm/default/tmpl/post.tmpl
===================================================================
RCS file: /forum21/install/forum_data/thm/default/tmpl/post.tmpl,v
retrieving revision 1.88
diff -u -a -r1.88 post.tmpl
--- thm/default/tmpl/post.tmpl 9 Sep 2009 16:15:00 -0000 1.88
+++ thm/default/tmpl/post.tmpl 1 Oct 2009 13:59:28 -0000
@@ -15,6 +15,7 @@
{REF: curtime.tmpl}
{REF: usercp.tmpl}
{REF: stats.tmpl}
+{REF: draw_forum_path.tmpl} /* FRANK */
{REF: draw_select_opt.tmpl}
{REF: draw_radio_opt.tmpl}
{REF: rev_fmt.tmpl}
@@ -133,6 +134,7 @@
{PAGE: POST_PAGE message posting form}
{TEMPLATE: header}
{TEMPLATE: usercp}
+{FUNC: draw_forum_path($frm->cat_id, $frm->name, $frm->id, $msg_subject)}
<form action="{TEMPLATE: POST_PAGE_lnk3}" method="post" id="post_form" name="post_form" enctype="multipart/form-data" onsubmit="document.forms['post_form'].btn_submit.disabled = true;">
{DEF: _hs}
<input type="hidden" name="submitted" value="" />
|
|
|
|
|
|
|
|