rejetto forum

Macros

Mars · 231 · 81955

0 Members and 1 Guest are viewing this topic.

Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1934
    • View Profile
    • RAWR-Designs
Are you trying to show breadcrumbs or what? I am slightly confused....

You cant talk to macro with JavaScript without using post or get form data. Or AHAH, for example. Macro is Server Side, JavaScript is Client Side.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13275
    • View Profile
Code: [Select]
<script type="text/javascript">
var path = document.location.pathname;
var dir = path.substring(path.indexOf('/', 1)+1, path.lastIndexOf('/'));
</script>
{.set|directory|dir.}

as TSG says, your macro will run BEFORE the javascript, because it runs on the server, while javascript on the client.
try using %folder% instead.


Offline Chrisp6825

  • Occasional poster
  • *
    • Posts: 20
    • View Profile
Dang.. %folder%. I knew about that. I dont know why I didn't think about it. haha
Thanks. And no this isnt for bread crums.


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 1986
    • View Profile
about breadcrumbs: rejetto, can you simply modify the code source with this line?

result:=result+xtpl(p, [ '%bread-url%', e, '%bread-name%', ad[ i],'%bread-idx%', inttostr(i)
]);  //mod by mars 2009

He will add simply the variable %bread-idx% which allows to obtain the level of the sub-directory with as value 0 for the root.

I know that you will still ask me to justify the usefulness of such a variable ;D. to me it just seems obvious that there is a small hole to fill ;)



Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13275
    • View Profile
being a very little thing i don't need explanations about it. ;)
i would like to know if you or anyone would use it...

the point is not "hole to fill" or "easy to make".
more complex it is, more useful it should be to justify its existence.
i didn't invent this rule! http://fr.wikipedia.org/wiki/Principe_KISS ;)

i may also decide to include this thing without explanation, but this is not the general rule i try to apply to hfs development.
i'm sorry you see it as a caprice.
« Last Edit: February 05, 2009, 11:39:25 AM by rejetto »


Funboss

  • Guest
if they made a shoutbox, you can make a guestbook

But shoutbox uses external server. My HFS is established in the local network without the output into the Internet; therefore I want so that the messages in the guest book would remain locally in the same machine, where was established HFS

If you want to keep it simple, you can use an iframe in your template. Use php to create a simple and very costumizable shoutbox. You can use a text file instead of a database. You can use the usernames (%user%). Search the forum for 'Funboss Iframe' for more info about this. There is no need to use an external server, right?

Else { Forget my comment!  ;) }