71
kaotik
Re: smarty inside js file?
  • 2009/12/23 18:25

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


ah yes... I really need to stop copy/paste from older code

Frankblack: I find jquery easier especially after a beer or two kill the brain cells which aren't understanding the code
Regarding obs 1, your absolutly right. There is some discussion on the web regarding where to include javascript files. There are pro's and con's to both including in head or bottom of page.
obs 2; thanks for the info. It's good to know in case I encounter this too.
I tried installing debaser (3.05) but I get this error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE TABLE debaser_mimetypes ( mime_id int(11) NOT NULL auto_increment, ' at line 3
I'm going through the sql file to try and pinpoint what it is.



72
kaotik
Re: smarty inside js file?
  • 2009/12/23 14:58

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


Thanks. That's the method I'm using.
For anyone else searching for this, here's a mini tutorial.

Variables in javascript work a little diferent from php. Here's some code to exemplify:
//PHP
$a=2;
function 
test (){
echo 
$a;
}
// this will throw back an error of undefined variable
$a=2;
function 
test (){
global 
$a;
echo 
$a;
}
// this will output: 2

So as you can see, in PHP, if you want to use an existing variable inside a function, you must first declare it global.
Now in javascript:
//JAVASCRIPT
var a=2;
function 
test(){
alert (a);
}
//this will popup an alert window with: 2

In javascript, once a variable is declared (outside a function) it exists in all space. In example 2, if you declare a variable inside a function:
function test(){
var 
a=2;
}
alert (a);
//this throws a variable undefined error.

In this scenario, all variables declared inside a function are only local. This applies both to javascript and PHP.
Now back to my original problem.
In XOOPS there are 2 smarty variables you will use a lot: $xoops_url and $xoops_rootpath, since we can't use smarty directly in javascript files, how do we pass these values?
Step 1:
in your XOOPS smarty template:
</style>
<
script language="javascript">
var 
xoopsRoot="<{$xoops_rootpath}>";
var 
xoopsUrl="<{$xoops_url}>";
</
script>
<
link rel="stylesheet" href="<{$xoops_url}>/modules/greenlime/templates/js/newpost.css" type="text/css" media="all" />
<
script type="text/javascript" src="<{$xoops_url}>/modules/greenlime/templates/js/jquery-1.3.2.min.js"></script>

Now I can use the javascript variables "xoopsRoot" and "XoopsUrl" inside any javascript file that comes after.
You can do this for any other smarty variable (even your own)
..for a mini tutorial, not to shaby



73
kaotik
smarty inside js file?
  • 2009/12/23 12:24

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


Is there any way for smarty to be compiled inside a js (javascript) file?
The only alternative I can think of is, instead of using a js file, I use a standard html template file and place my javascript code inside that.

..any suggestions would be greatly appreciated.

Thanks



74
kaotik
Re: Help for a newbie
  • 2009/12/15 13:38

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


Hello bhw_webmaste, welcome to xoops!
I've recently installed wordpress and let me start by saying it's a great system. Woks flawlessly from the start and gives you a great "out of the box" experience. It also has a high level of integration between all it's components, meaning you don't have to worry about compatibility.
That said, what's the difference to xoops?
Xoops is highly modular. While in wordpress you basically have 1 "content module", with XOOPS you could have 2,3 or as many as you like. This would allow you to separate content according to your own standards.
This also means you can have XOOPS do all sorts of interesting stuff, such as being a newsgroup reader and a lot more, just browse through the modules section to get an ideia.
Another big advantage is it's permission system. With XOOPS you can create groups, then assign then items theye are allowed to manipulate. For example. You can install a download module, create download categories then assign XOOPS groups to them. This means certain users can see a category while others can not. This permission system is highly flexible. You can add users to 1,2 or as many groups as you like.
With this modular design and high level of flexibility also brings an initial learning curve, terms such as, themes and templates are familiar to you, but we also have blocks and modules (you call them widgets).



75
kaotik
Re: Learning from others: Wordpress through the eyes of a xoops developer
  • 2009/12/14 11:45

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


There seems to be a miscommunication... I wasn't suggesting any kind of core hack or change. I was discussing the possibility of 2.4.2 coming with a content module. The idea would be for a user, on XOOPS installation, to also install a content module. This would allow him to immediately 'play' with xoops. If he wants he can later install a different content module.
Think of this as the "packs" idea, besides this is just a small test from me.



76
kaotik
Re: Learning from others: Wordpress through the eyes of a xoops developer
  • 2009/12/13 16:23

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


hello red_slider and mjoel
I'm tinkering with XOOPS 2.4.2, a content module and 1 wysiwyg editor to achieve a similar experience to that of wordpress.
I have a pretty good idea of what the end result will look like, it's getting there that will take some work
mjoel: I've been meaning to try XOOPS Cube for some time...



77
kaotik
Learning from others: Wordpress through the eyes of a xoops developer
  • 2009/12/11 16:42

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


Once in a while I like to experiment with other cms's/frameworks to see what others are offering and what I can learn. In that spirit I decided to try the latest worpress and publish here my findings. So, here goes:
Wordpress has a very interesting approach. It has one content "module" that's tightly integrated into the core. It also has one wysiwyg editor and media manager(similar to xoops). This allows it to be highly integrated. I (or any other XOOPS user) could achieve the same result with at least a dozen different XOOPS modules and at least 4 wysiwyg editor's. But what really struck me is that, as soon as you install wordpress, your site is ready to go online with content! This reminded me of the early days of XOOPS (when it came with news, polls, download and more). You downloaded it and were ready to 'play'!
This tight integration is both a plus and minus;
Minus- this level of integration means you can't install another content module
Plus- With this level of integration you can rest assured there won't be "problems" with it's usage, plus everything works fluidly.
Administration
Another big plus, is the dashboard (what we call admin theme). When you enter the administration area, you get all pertinent information regarding your site, including pending comments, pages or content. We could accomplish this in XOOPS (I have in the past with an admin theme called vitamin C), but we currently have no admin theme that works quite in the same manner.
First Time with Wordpress
Wordpress installs with one example article, one page and one comment. This allows new users to see how things work right from the very start. This saves a LOT of time, instead of hunting around. This also means that many more people who try out wordpress, stick with it. I believe there are a lot of people who download XOOPS for the first time, can't understand how to publish an article/content and then go on to try something else. This might also be one of the possible reasons why wordpress has such a vibrant array of themes. Since it's a "works right out of the box" experience it's highly likely more designer's will use it. Of course coders will see the benefit's of systems such as XOOPS and drupal with their high level of modularity, basically transforming them into frameworks.
Templates
On the negative side, I'm not a big fan of their template system. I still prefer smarty (I know there are people against smarty, but we are all entitled to an opinion). I believe a template should be handled by a wysiwyg editor.
Conclusion
Wordpress has evolved into a great system! Of course it doesn't have the level of modularity that XOOPS has but it provides first time users with a great "out-of-the-box" experience. Could we accomplish the same with xoops? Yes. But currently we provide so many different options, that a new user might feel lost on how to accomplish even the most simple tasks, such as publishing an article.
Here's a thought, why not create a create a blog pack, where 1 content module and 1 wysiwyg editor is provided?
Overall I'm impressed with wordpress. We can learn a lot from their approach.



78
kaotik
Re: Functioning webmail module
  • 2009/11/26 16:28

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


I'm the original creator of tropical mail (xoops port of iloha mail). I stopped supporting it around the time all these free accounts (gmail, bigger yahoo, etc) started appearing.
My times scarce now (I was supposed to have released a module in November, which I've had to push back 1/2 months) due to a commercial project.



79
kaotik
phppp: new xoops architecture
  • 2009/11/20 12:56

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


Hello phppp
I'm putting my questions in the forum instead:
phpp wrote:
Quote:

I am currently focused on two points:
for XOOPS project, build the new XOOPS software architecture;
for XOOPS development, build a practical support ecosystem.

I have finished proof of concept for XOOPS new architecture, a site will be launched soon built on the new architecture.
For support ecosystem, we already have some meaningful practice, hope we can share something with the community.


Will this new architecture work in a similar way as xoops-cube, where a legacy module is provided to support modules from previous versions?
What can we expect in terms of template engines? Will smarty still be standard?
In what direction do you see XOOPS moving?
What major changes will there be?

Thanks for your time



80
kaotik
Re: Request: Code to retrieve username of the user currently logged in
  • 2009/11/19 12:53

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


are you looking to retrieve it in the smarty templates are a php page?
noo-b has already provided you with a smarty example.




TopTop
« 1 ... 5 6 7 (8) 9 10 11 ... 59 »



Login

Who's Online

213 user(s) are online (129 user(s) are browsing Support Forums)


Members: 0


Guests: 213


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits