Conversation with Ahriman at 2004-02-17 22:44:07 on chealer@irc.freenode.net (irc) (22:44:07) Ahriman: Huhu! (22:44:10) chealer9: hu! (22:44:27) Ahriman: Better do this on a query, otherwise the others will be a little bit upset again *g* (22:44:53) chealer9: yeah, well I don't guarantee you won't to copy-paste to main window but anyway :) (22:45:16) Ahriman: Oki - let's give it a try... (22:45:51) Ahriman: And - by the way - my English is not SO good that I understand evenything fast enough - should be better but it isn't (22:46:55) chealer9: eh, my last sentence was missing a word do I don't help you (22:47:03) chealer9: don't trust me niether, I'm francophone (22:47:23) Ahriman: Well - I have my site on www.ahriman.info and want to create a simple content template (22:47:46) Ahriman: At the moment it looks like that: (22:47:47) Ahriman: (22:47:47) Ahriman: (22:47:47) Ahriman: (22:47:47) Ahriman: HEADLINE (22:47:47) Ahriman: (22:47:51) Ahriman: (22:47:53) Ahriman: TEXT (22:47:55) Ahriman: (22:47:57) Ahriman: (22:47:59) Ahriman:   Last modified: DATE by AUTHOR (22:48:05) Ahriman: (22:48:07) Ahriman: (22:48:09) Ahriman: (22:48:11) Ahriman: (22:48:13) Ahriman: (22:48:15) Ahriman: [top] (22:48:17) Ahriman: (22:48:19) Ahriman: (22:49:19) Ahriman: The point I want to change now is this date (22:49:51) Ahriman: When I look into the tiki-admin_html_pages.tpl there are all sites shown with the date when they where last modified (22:50:22) Ahriman: I want to insert exactly this date at the bottom of the template page (22:51:03) Ahriman: So that   Last modified: DATE by AUTHOR should be something like   Last modified: {smarty variable} by AUTHOR (22:52:00) Ahriman: I already took the {...} from the tiki-admin_html_pages.tpl and inserted it just like it was there - but when I display the template the variable gets shown (22:52:04) Ahriman: Any idea? (22:52:33) chealer9: hum, could you paste it? (22:53:03) Ahriman: A moment please (22:53:26) Ahriman: {$channels[user].created|tiki_short_datetime} (22:54:13) chealer9: what about taking one nearer from articles? (22:55:06) Ahriman: ie? (22:55:28) chealer9: like from tiki-view_articles.tpl? (22:55:36) chealer9: I'm seeing {$listpages[ix].publishDate|tiki_short_datetime} at first glance (22:56:34) Ahriman: I think the problem might be, that this are variables inside the {...} - and I don't think that they should be defined (22:57:05) chealer9: I'm not sure I understand you well (22:57:15) chealer9: you mean you don't think they are defined in your template? (22:57:21) Ahriman: Yes (22:57:21) chealer9: If yes I think so too (22:57:37) Ahriman: But I don't know how to do that (22:57:58) chealer9: indeed I don't see why $channels[user].created would be passed in articles (22:58:05) chealer9: take on that's already displayed (22:58:20) chealer9: didn't the above generate some thing at least? (22:58:51) Ahriman: The above code it html only (22:59:12) chealer9: hm, you mean it doesn't get parsed? (22:59:34) Ahriman: ??? (22:59:48) Ahriman: I think now it gets difficult, hehe (22:59:49) chealer9: Ahriman: The above code it html only which above code? (23:00:06) Ahriman: The code of the existing template I want to change (23:00:31) chealer9: OK, yes, so what? (23:01:10) Ahriman: Maybe there has to be some code inserted where the variables are defined? (23:01:37) chealer9: hum, you mean in the PHP? (23:01:41) Ahriman: yes (23:01:49) chealer9: what would it do? (23:01:51) Ahriman: I don't know what to do to get this template showing the last modification date (23:02:02) chealer9: yeah, I'm checking if that's available (23:02:57) chealer9: yep, checking I don't think the last updated time is available (23:03:17) chealer9: I can't see it in current articles, and it's absent from tiki_articles table (23:03:37) chealer9: so you would probably have to do Smarty, PHP and SQL hacking to get it. (23:03:59) Ahriman: Hmmmmmmmmmm (23:04:22) Ahriman: There is the date/time of the last modification of a page stored in the db, right? (23:04:36) chealer9: oh, a HTML page? (23:04:49) Ahriman: Yes (23:04:58) Ahriman: It is a template for html pages (23:04:58) chealer9: aaah (23:05:02) chealer9: lol (23:05:13) chealer9: I was reading (23:05:22) chealer9: thought you were talking about articles (23:05:32) chealer9: hgum, let me see closer then (23:05:36) Ahriman: No sorry (23:05:46) Ahriman: Taht's only part of my template code (23:07:01) Ahriman: I think it should be possible to take the name/id/whatever is needed to identify the html page in the db, put this into a variable, pass this variable to smarty, let smarty search for date/time last modified and display the return value of the smarty engine (23:07:19) Ahriman: But - as I am noob with smarty and PHP I need some help :) (23:10:57) chealer9: OK I'm rereading the discussion to check with new ligth (23:11:11) Ahriman: Okay (23:11:12) Ahriman: :) (23:13:07) chealer9: so, you named that tpl tiki-admin_html_pages.tpl? (23:13:14) chealer9: replacing the old one? (23:13:29) Ahriman: Ähm (23:13:31) Ahriman: Nooo (23:13:32) Ahriman: *g* (23:13:46) Ahriman: This template has nothing to do with the usual tpls (23:13:57) Ahriman: It's just a template for content html pages (23:14:18) chealer9: did you change the smarty command in tiki-admin_html_pages.php then? (23:14:48) Ahriman: No (23:15:23) chealer9: so, basically, you're looking for a way to define those variables without using the tiki frame? (23:16:36) Ahriman: It's hard for me to answer this question - the tiki appearance with the modules to the left and right is shown when you crete html pages (23:16:50) Ahriman: Do you mean that with "tiki frame"? (23:17:22) chealer9: no, I mean...all other Tiki files, like you don't want to laod tiki-setup.php and tikilib.php when this page generates? (23:17:39) chealer9: you want to keep the modules? (23:17:50) Ahriman: Wait a moment please (23:18:02) Ahriman: http://boraas.dd1110.kasserver.com//tiki-page.php?pageName=Impressum (23:18:09) Ahriman: Take a look at this page please (23:18:11) chealer9: :) (23:18:28) Ahriman: This is one of the html pages of my homepage (23:18:37) Ahriman: I applied the template to it (23:19:27) chealer9: OK, things are much clearer (23:19:30) Ahriman: And then I want to be able to create other html pages within my tiki page - and I want to display on all these pages something like that: (23:19:34) chealer9: the date currently shows...? (23:19:37) Ahriman: Last modified: 16. 02. 2004 by Ahriman (23:19:48) Ahriman: that is hardcoded (23:19:50) Ahriman: at the moment (23:19:58) Ahriman: And I want it to be automatically inserted (23:20:20) chealer9: aaahh! I think I understand now (23:20:31) Ahriman: At the moment it's like   Last modified: DATE by AUTHOR - very unprofessional (23:20:47) chealer9: damn, I can't even help you (23:20:48) Ahriman: I want this date/time of the last modification to be automatically displayed (23:20:56) chealer9: this is not designed to be done (23:21:07) chealer9: smarty variables are not supposed to be passed there (23:21:21) Ahriman: Well (23:21:25) chealer9: if you're still wondering how to make it possible, well...let me a minute to think (23:21:34) Ahriman: It IS displayed in tiki-admin_html_pages (23:22:03) chealer9: yes, but the content template is only HTML. it doesn't access to smarty variables (23:22:15) Ahriman: name type last modif action (23:22:15) Ahriman: PBMember s 18. 02. 2004 [00:45] view content (23:22:19) Ahriman: It looks like this (23:22:23) chealer9: you would have to get the templates parsed as Smarty code instead of only HTML (23:22:34) Ahriman: How do I make that? (23:22:37) Ahriman: *g* (23:22:40) chealer9: yeah, I understand this (23:23:00) chealer9: this code comes from tiki-admin_html_pages.tpl (23:23:17) chealer9: but you can in few places only put Smarty code in Tiki (23:23:20) Ahriman: These two lines from just abpve - yes (23:23:24) chealer9: you can in modules by example (23:23:37) Ahriman: Oh (23:23:48) Ahriman: So - what to do to get this running in a template? (23:24:09) chealer9: hum, I never looked at that more than you (23:24:22) chealer9: do you feel like investigating how it's done in modules code? (23:24:51) Ahriman: I am new to PHP and the related stuff - I don't know if I would understand that (23:25:01) chealer9: I'll quick check smarty doc about a magic function for that (23:25:06) chealer9: yeah... (23:25:30) Ahriman: To be honest - I don't believe I would understand (23:25:38) Ahriman: But I WANT to - just need some help :) (23:28:43) chealer9: tiki-admin_modules could be the quickest way to find out how it's done (23:29:44) Ahriman: Hmmmmmm (23:30:04) Ahriman: the tpl or the php file? (23:30:22) chealer9: both I guess (23:30:45) chealer9: (I'm looking a bit) (23:31:01) Ahriman: Me too (23:31:11) chealer9: {$preview_data}... (23:31:58) chealer9: $smarty->assign_by_ref('preview_data', $data); (23:32:10) chealer9: so we're looking for how it gets $data value (23:32:28) Ahriman: If you say that *g* (23:32:35) Ahriman: *is a little bit confused+ (23:32:55) chealer9: you'll have to understand this part at least (23:33:13) chealer9: find {$preview_data} in the .tpl (23:33:26) chealer9: you see it will show the module preview (23:33:40) chealer9: in the .php it's assigned the value of $data (23:33:43) Ahriman: found it (23:34:13) chealer9: $data = $smarty->fetch('modules/user_module.tpl'); } else { $phpfile = 'modules/mod-' . $_REQUEST["assign_name"] . '.php'; $template = 'modules/mod-' . $_REQUEST["assign_name"] . '.tpl'; if (file_exists($phpfile)) { $module_rows = $_REQUEST["assign_rows"]; parse_str($_REQUEST["assign_params"], $module_params); include ($phpfile); } if (file_exists('templates/' . $template)) { $data = $smarty->fetch($template); } else { $data = ''; (23:34:23) chealer9: there are three assignations (23:35:24) Ahriman: The ones with $_REQUEST (23:35:25) chealer9: it's an user module (23:36:03) chealer9: so it must be in $data = $smarty->fetch('modules/user_module.tpl'); (23:37:06) chealer9: http://smarty.php.net/manual/fr/language.function.fetch.php (23:38:38) chealer9: so it redirects to user_module.tpl :/ (23:38:59) Ahriman: Hm (23:39:25) Ahriman: when I understand that right - then this will be a lot more work than I thought (23:40:17) chealer9: {eval var=$user_data}... (23:42:32) chealer9: $info = $tikilib->get_user_module($_REQUEST["assign_name"]); (23:42:46) chealer9: that's big digging :S (23:42:59) Ahriman: Hmmmm (23:43:21) Ahriman: The question I know have is - how do I get smarty working with my template first? (23:43:46) chealer9: you mean how to make Smaty parse your content template? (23:44:15) Ahriman: I already tested it with a smarty command (23:44:33) Ahriman: If smarty would have been active - I would probably have got an error msg (23:44:51) Ahriman: So - I will have to do something that smarty works with this - right? (23:45:25) chealer9: yes, let me check a few more minutes (23:45:32) Ahriman: k (23:46:27) chealer9: I found the key (23:46:45) chealer9: that magic smarty command I was talking about is http://smarty.php.net/manual/fr/language.function.eval.php (23:47:04) chealer9: maybe the template can be hacked quickly even (23:49:16) Ahriman: Just bookmarked the smarty site and the german documentation (23:49:28) Ahriman: I think I should read at least some parts of it (23:49:43) chealer9: I'm pretty much done (23:49:49) chealer9: that {$parsed} in tiki-page.tpl (23:50:02) chealer9: if you hack it with eval, I think you can get what you want (23:50:35) chealer9: replace it with {eval var=$parsed} (23:50:40) chealer9: try that, I didn't (23:50:50) chealer9: there are good chances this is all you need (23:51:19) chealer9: hum...well, it will generate an error I guess, as you said (23:51:55) chealer9: you'll have to hack tiki-page.php to go further and assign something to the variable then I think (23:52:12) Ahriman: Hmmmmmmmm (23:52:22) chealer9: can you get the error? (23:52:22) Ahriman: A totally other question (23:52:50) Ahriman: Looks like it would be easier to get the date/time without smarty out of the db? (23:53:31) chealer9: hmm, I don't think (23:53:36) chealer9: you can always try though (23:53:51) Ahriman: Damn (23:54:06) chealer9: well actually you wouldn't have good visual result (23:54:10) Ahriman: I thought I would be able to program things by now - looks like I was wrong (23:54:24) Ahriman: :( (23:54:32) chealer9: what do you get with the replacement in tiki-page.tpl? (23:54:35) Ahriman: I only understand the half of what you say (23:54:39) Ahriman: Mom (23:54:55) chealer9: yeah, I'm not tlaking assuming you understand everything (23:55:03) chealer9: ask questions if you miss something (23:55:09) chealer9: but try that first :) (23:57:01) Ahriman: I inserted {eval var=$parsed} in the tiki-page.tpl now and uploaded it (23:57:58) Ahriman: the homepage itself seems to work properly (23:58:10) Ahriman: CAN this change affect the rest of the HP? (23:58:45) Ahriman: I mean - what does {$parse} do? (23:59:07) chealer9: {$parsed} must be the parsed HTML code (23:59:15) chealer9: from your HTML page (23:59:17) Ahriman: {eval var=$parsed} seems to be a smarty command that calls the function eval with the parameter $parsed (23:59:24) Ahriman: right? (23:59:24) chealer9: yes (23:59:27) Ahriman: k (23:59:59) Ahriman: What exactly IS {$parsed} - a variblae? (00:00:05) Ahriman: A call of a function? (00:00:35) Ahriman: [05:59] {$parsed} must be the parsed HTML code <--- I think it's just a variable that includes the HTML Code (00:00:38) Ahriman: right? (00:01:37) chealer9: yes (00:01:49) chealer9: it's a Smarty variable (00:01:57) chealer9: it's assigned value from tiki-page.php (00:02:03) Ahriman: k (00:02:06) Ahriman: then... (00:02:15) chealer9: I'm not sure why it reads parsed (00:02:40) Ahriman: The change in the tpl - why doesn't it affect the whole page? (00:03:09) chealer9: I don't know which homepage you talk about? (00:03:21) Ahriman: Ah (00:03:24) Ahriman: the whole tiki page (00:03:37) Ahriman: Why does this change not cause any errors? (00:03:47) chealer9: I ddin't look at the result yet (00:03:58) Ahriman: It works (00:04:08) Ahriman: At least - it seems to work (00:04:10) chealer9: that's your homepage? (00:04:52) chealer9: you,re talking about the same page you linked me to earlier? (00:04:57) Ahriman: I changed the tpl like you said and applied the file to my www.ahriman.info (00:05:02) chealer9: I don't understand the language so I can't guess (00:07:47) Ahriman: It looks like everything works fine with this change (00:12:10) Ahriman: {$channels[user].created|tiki_short_datetime} (00:22:39) Ahriman: Hmmmmm (00:23:35) Ahriman: Am I right assuming, that it might work, if i assigned the name of the html-page as a variable and then do {variable.created|tiki_short_datetime}? (00:24:06) Ahriman: But - then the problem how to "activate" smarty still remains (00:24:06) chealer9: well, you'll need more than the name (00:24:29) chealer9: I didn't understand your feedback about the replacement I proposed (00:24:34) chealer9: did it generate errors? (00:24:56) Ahriman: no (00:25:04) chealer9: so it doesn't work? (00:25:45) Ahriman: I just replaced the {$parsed} in the tiki-page.tpl with {eval var=$parsed} (00:25:53) Ahriman: Up to now - there were no errors (00:26:09) Ahriman: {$channels[user].created|tiki_short_datetime} <--- this is in the template now (00:26:17) chealer9: ah OK (00:26:17) Ahriman: But it doesn't work at all (00:26:29) Ahriman: The output is at the moment like this: (00:26:35) Ahriman: Last modified: {$channels[user].created|tiki_short_datetime} by AUTHOR (00:26:42) chealer9: OK (00:26:49) Ahriman: So - Smarty seems not to be "active" (00:26:56) chealer9: yeah... (00:27:06) chealer9: you're sure you don't have a tpl cache issue? (00:27:47) Ahriman: How can I find out if I have one? (00:28:08) chealer9: add test stuff to the tpl and see if it shows (00:28:11) Ahriman: When i open my homepage where the changes should effect the page there are NO errors at the moment (00:28:34) chealer9: yeah, well that seems to indicate smarty indeed doesn't parse the content template (00:30:33) Ahriman: [06:28] add test stuff to the tpl and see if it shows <-- What did you mean? (00:30:37) Ahriman: to ehich tpl? (00:30:46) chealer9: tiki-page.tpl (00:31:23) chealer9: let's say add {eval var=$parsed} instead of replacing {$parsed} with it (00:32:21) Ahriman: I'll try (00:33:44) Ahriman: Now both lines are inside the tpl (00:33:49) Ahriman: Seems to work still (00:34:01) chealer9: yeah, so it doubles the output? (00:34:07) Ahriman: no (00:34:15) chealer9: hum...nothing changed? (00:34:35) Ahriman: No (00:34:46) Ahriman: the page works as it should do (00:34:49) chealer9: well you should make sure that your templates_c is cleared (00:35:07) chealer9: if you have both lines it should show the HTML twice (00:35:45) Ahriman: the templates_c is empty (00:35:51) Ahriman: Only a README inside (00:36:00) chealer9: ??? (00:36:17) chealer9: did you desactivate cache generation or what? (00:37:50) Ahriman: Where can I see that? (00:37:59) ***Ahriman looking at the features (00:38:00) chealer9: I don't know (00:38:16) chealer9: I don't think you can control that from the Tiki interface (00:38:31) chealer9: did you tweak the Smarty configuration files? (00:38:51) Ahriman: I can't change anything on the server - I only pay for some webspace (00:38:52) Ahriman: No (00:39:10) Ahriman: I am a noob and do only changes I know what they will do ;) (00:39:15) chealer9: well, that must be your first issue then (00:39:45) Ahriman: ? (00:40:05) Ahriman: What do you mean? (00:40:18) chealer9: oh maybe you misunderstood me (00:40:36) Ahriman: Ah (00:40:39) Ahriman: Hehe (00:40:44) Ahriman: I AM a newbie (00:40:47) Ahriman: That's okay (00:40:58) chealer9: when you say templates_c is empty, do you mean you have only language directories in it or really only readme? (00:41:14) Ahriman: there is one dir named en (00:41:17) Ahriman: But it's empty (00:41:29) chealer9: but are there directories in it? (00:41:44) Ahriman: No (00:41:54) chealer9: ok (00:42:00) Ahriman: only one dir called en inside the templates_c (00:42:13) Ahriman: The en dir is totally empty, no hidden files (00:42:15) chealer9: so, what I meant is, the first problem you must solve is your Smarty cache generation (00:43:53) Ahriman: How to do that? (00:44:04) chealer9: lol, I don't know (00:44:13) Ahriman: Oki (00:44:16) chealer9: I couldn't even imagine Tiki could work without it (00:44:31) chealer9: it must be sooo slow! (00:44:48) Ahriman: Well (00:44:54) Ahriman: I just installed tw and it runs (00:45:28) Ahriman: I only changed some template changes that sURELY had no effect except another display (00:46:30) chealer9: yes (00:46:38) chealer9: so, see you when you have that sorted out