That works great for most projects, and some echo statements carefully placed, but it gets harder to do that when debugging JavaScript or Ajax requestsThis is a long way from what I currently do - run stuff on the sandbox.
That works great for most projects, and some echo statements carefully placed, but it gets harder to do that when debugging JavaScript or Ajax requestsThis is a long way from what I currently do - run stuff on the sandbox.
Can you explain further? I mean explain how to do that?finding out what objects and variables are available, etc.
Those would be the ideal world, realistically the bare minimum is somewhat competent in PHP, HTML and usually SQL.Being able to produce addons for Xenforo requires competency in PHP, SQL, JavaScript and Ajax, CSS and skills in UI implementation and design. Did I omit anything?
As long as you aren't designing complex stuff, the XenForo-provided defaults mean you don't need overly complex javascript/ajax/css.Being able to produce addons for Xenforo requires competency in PHP, SQL, JavaScript and Ajax, CSS and skills in UI implementation and design. Did I omit anything?
Following from Xon, in modern frameworks (hopefully XenForo 2) queries aren't done much manually. For example, all my apps in Laravel I don't think I've wrote one raw SQL query.As long as you aren't designing complex stuff, the XenForo-provided defaults mean you don't need overly complex javascript/ajax/css.
And most developers have a poor understanding of SQL, especially of SQL running on a busy forum.
Definitely XF 2.0.hopefully XenForo 2
$post = $this->finder('XF:Post')
->with('Thread')
->where('post_id', 2)
->fetchOne();
$post = $this->_getDb()->fetchRow('
SELECT post.*, thread.*
FROM xf_post AS post
INNER JOIN xf_thread AS thread ON
(post.thread_id = thread.thread_id)
WHERE post_id = ?
', 2);
You need to start somewhere and start little.Being able to produce addons for Xenforo requires competency in PHP, SQL, JavaScript and Ajax, CSS and skills in UI implementation and design. Did I omit anything?
What does that do?![]()
Think you should have an ORM like Laravel.Definitely XF 2.0.
PHP:$post = $this->finder('XF:Post') ->with('Thread') ->where('post_id', 2) ->fetchOne();
Instead of:
PHP:$post = $this->_getDb()->fetchRow(' SELECT post.*, thread.* FROM xf_post AS post INNER JOIN xf_thread AS thread ON (post.thread_id = thread.thread_id) WHERE post_id = ? ', 2);
This is equivalent to:$post = Post::where['post_id' => '123']
->first();
$post = $this->finder('XF:Post')->where('post_id', 123)->fetchOne();
This is equivalent to:$post->thread()->id;
$post->Thread->thread_id;
Nifty, sounds good. Can't waitIt's essentially the same thing, though it's our own so we have made it and will make it into what we need.
This is equivalent to:
PHP:$post = $this->finder('XF:Post')->where('post_id', 123)->fetchOne();
This is equivalent to:
PHP:$post->Thread->thread_id;
You'll notice when we fetched the post, we didn't specify "->with('Thread')", but regardless we can still call "->Thread" which dynamically fetches the appropriate Thread object.
This is a good tactic.You need to start somewhere and start little.
You need to set a goal for yourself which you can reach and slowly progress to that.
If your expactations are to code big add-ons in a short time, then of course you will fail.
From what I have seen, for little stuff all you need to know is PHP and SQL knowledge.
I am in the same boat as you. Don't setup too big expactations. Start little. I mean, let's say you coded one little add-on for your site. That means 1 add-on you are not dependant on anybody. A win-win.
Yep, that is how I approach it now. It is better to start somewhere and doing little stuff, than waiting for someone else creating it (if at all).This is a good tactic.
My first add-ons were just essentially template modifications. My first add-on that used any sort of JavaScript was probably a year or two later.
Definitely a good tactic. My first was the same. I still haven't needed js in an add-on yet.This is a good tactic.
My first add-ons were just essentially template modifications. My first add-on that used any sort of JavaScript was probably a year or two later.
While the syntax that @Chris D and others has show is welcome, this doesn't stop people from writing poorly designed queries. Or writing a query which works well at small scale but falls apart at a large scale.Following from Xon, in modern frameworks (hopefully XenForo 2) queries aren't done much manually. For example, all my apps in Laravel I don't think I've wrote one raw SQL query.
We use essential cookies to make this site work, and optional cookies to enhance your experience.