Store Community Support Documentation
Please only reply if you are a third party developer or designer.

We want to make it extra easy for you to create new content for the phpfox script. As core developers we find it very easy because we built the script so we may be overlooking obvious annoyances. One good example I can think of is how it is possible to completely change the flow of the script and not load a module but another when going to a specific section (effectively replacing a module without touching the files), I see that as a one or two liner plug in but maybe its not so clear to some developers how to do that.

If you think we need better documentation, have you looked at the API or the knowledgebase?
If you mean features in the script (like another section in the AdminCP) please post them here, what we're after is finding out how to improve the script to make it easier for you as a developer/designer to create new content.
Donna(data66)
#36
Did you file that as a feature request in the tracker?
#37
Quote:
Originally posted by: data66

Did you file that as a feature request in the tracker?


No, I figured that the Wish List might be a better place for RFEs, i.e. "not bugs". I'll file it. Thanks.
#38
Quote:
Originally posted by: data66

Did you file that as a feature request in the tracker?


I see now that the tracker has a "Feature Request" section. I've filed the RFE there:
http://www.phpfox.com/tracker/view/12729/

Thank you data!
Donna(data66)
#39
You're welcome. Pure does not have lots of time in the forum so first place he looks and the other core devs look, is in feature requests.
#40
Quote:
Originally posted by: data66

You're welcome. Pure does not have lots of time in the forum so first place he looks and the other core devs look, is in feature requests.


I see. Therefore, what is the purpose of this thread?
Donna(data66)
#41
Please see the date:

Posted December 15, 3:41 am 2010
#42
Quote:
Originally posted by: data66

Please see the date:

Posted December 15, 3:41 am 2010

I infer that the Feature Request option did not exist then. If this thread is outdated, then perhaps the "sticky" flag should be reconsidered.

Thank you Data.
#43
Quote:
Originally posted by: dotancohen

One thing that I feel is missing in phpFox is the ability to render a template to a PHP variable for further processing. This would allow complex layouts to be reused. Right now we can use a Smarty foreach in a template to include an additional template multiple times, but that is extremely limited. I imagine a syntax such as the following:

$oForumPostTemplate = Phpfox::getTemplate('somemodule.sometemplate');
$oForumPostTemplate->assign('sSomeVar', $sSomeVar);
$sForumPost = $oForumPostTemplate->render();


That would allow for some real 1337 coding ability:

$sAllPosts = '';
foreach ($aUsers as $aUser)
{
if ( 18 < $aUser['age'] || TRUE===$aUser['parentalConsent'] )
{
$oAdultTemplate = Phpfox::getTemplate('somemodule.adulttemplate');
$oAdultTemplate->
assign('aUser', $aUser);
$sAllPosts .= $oAdultTemplate->render();
}
else
{
$oUnderageTemplate = Phpfox::getTemplate('somemodule.underagetemplate');
$oUnderageTemplate->assign('sUserName', $aUser['name']);
$sAllPosts .= $oUnderageTemplate->render();
}
}


I should mention that other CMS options, such as vBulletin, do have this feature.


It has been a long time since I have worked with vb, but I think the basic design and core concept template is quite different. In fox there is only one mammoth template class, and it is a manager, factory, renderer, cacher and bottle washer. A diagram is needed to show the difference.

Looks like you are building a string for output in vb. Whereas fox echos directly, so the rendered content has to be captured with output buffering. At least I *think* that is true for controller templates, and I think block templates can be put into strings without a fuss.

But didn't we get started on this in another thread? Is not possible to do what you want already?

I'm game to work it out with you, it might shed some light on some of the funkier template methods. We really ought to be able to select a template, assign a few variables then fetch the rendered result.

I think the other thread already showed how. Just put that into a render function and we are done?

Look pretty do-able on our own. The only thing that bothers me is fox may already be doing it somehow, and maybe it's dead simply and built in already... again I wonder out loud about the nested browse/search template stuff. There is a technique in there that I haven't grokked.

But I ramble. As usual.
#44
Quote:
Originally posted by: steward
But didn't we get started on this in another thread? Is not possible to do what you want already?


Purefan did demonstrate how to call a template _from_another_template_, with a single argument (though it can be an array).

The truth is that that particular solution is not what I had asked in the OP, in fact I did ask how to render a template into a string. Rendering a template into another template with a single argument did resolve the _example_situation_ in the OP. However, in addition to requiring significant refactoring of the code, it will not work for the next step of this project for which I will need to run some PHP logic such as that demonstrated in the RFE.

I am aware that I can simply code PHP right in the template file but I am trying to avoid that. In the meantime I will simply create the strings that I need without templates, and I will port them to templates if/when phpFox supports rendering templates to strings.

I have workarounds, but I feel that phpFox can be made better for developers by this feature so I requested it.
Last update on February 6, 7:52 am by dotancohen.
#46
Quote:
Originally posted by: dotancohen



Purefan did demonstrate how to call a template _from_another_template_, with a single argument (though it can be an array).

The truth is that that particular solution is not what I had asked in the OP, in fact I did ask how to render a template into a string. Rendering a template into another template with a single argument did resolve the _example_situation_ in the OP. However, in addition to requiring significant refactoring of the code, it will not work for the next step of this project for which I will need to run some PHP logic such as that demonstrated in the RFE.

I am aware that I can simply code PHP right in the template file but I am trying to avoid that. In the meantime I will simply create the strings that I need without templates, and I will port them to templates if/when phpFox supports rendering templates to strings.

I have workarounds, but I feel that phpFox can be made better for developers by this feature so I requested it.


It sounds like you want functionality similar to Smarty's $foo = $smarty->fetch(), or even like Smarty's prefilters, postfilters and outputfilters. Is that correct?
#47
Quote:
Originally posted by: dotancohen

it will not work for the next step of this project for which I will need to run some PHP logic such as that demonstrated in the RFE.

I am aware that I can simply code PHP right in the template file but I am trying to avoid that.


I still dont understand why blocks wouldn't work for you. I support the 'no-php-in-templates' movement, for me the {php} tag is... Tongue

Maybe I still dont understand what are you trying to do exactly but here's an example that might help:
/module/blah/include/component/controller/index.class.php
$bIsUnder = false;
if (Phpfox::getUserBy('something') < 18) $bIsUnder = true;
$this->
template()->assign(array('bIsUnder' => $bIsUnder));


/module/blah/template/default/controller/index.html.php
{if $bIsUnder}
{module name='blah.under'}
{else}
{module name='blah.over'}
{/if}


/module/blah/include/component/block/under.class.php
if (Phpfox::getUserBy('birthday') != '')
{
// Just for formatting
$sBday = Phpfox::getUserBy('birthday');
$iEnd = mktime(date('H'), date('i'), date('s'), substr($sBday,2,2), substr($sBday, 0,2), date('Y'));
$iDaysToEnd = Phpfox::getLib('date')->daysToDate($iEnd);
$this->template()->assign(array('iDaysToBday' => $iDaysToEnd));
}


/module/blah/template/default/block/under.html.php
{if isset($iDaysToBday)}
Your birthday is in {$iDaysToBday}
{/if}


Here I kept all the logic in the components (in the /component/controller/index.class.php and in the /component/block/under.class.php) and applied flow control in the templates. If I had a language phrase I could have written under.html.php like this:
{if isset($iDaysToBday)}
{phrase var='blah.days_to_bday' idays=$iDaysToBday}
{/if}

Assuming that the language phrase is:
Your birthday is in {idays}

Hope it helps
How about the implementation of a jquery/html5 file uploader for the massuploader instead of the flash massuploader, such as: http://blueimp.github.com/jQuery-File-Upload/

Is there any way this can be implemented? I cannot understand correctly how the Add Photo form is processed into the database, so that I can try and implement this uploader.

Thanks!
Aldoseri
#49
2 things will make my life much easier and will help me get better control on the design.

1- Every time you need to include CSS attributes in php or js. Ask yourself can this go on a stylesheet?

2- Then if you can make rtl.css load last even after custom.css then this will shave 50% of the troubles when designing for RTL layouts and I won't have to touch core files.

you think fox support RTL but this is not 100% true. I spend between 10 days to a whole month just to flip things around the right way then with every update I need to redo parts of it and keep track of all the changed files.

Even selling the script to my clients is a scary thing because I have to think of the time to support them.
Zenepay
#50
I think too many add-ons can cause system slow down.
If the based modules can do best this will help a lot.
For example, the best blog, we all know it is wordpress. So, make our blog look like wordpress. The blog list page, should contain feature picture. The header can enter blog owner google plus link for SEO., social like buttons/share.

Market place should contain shopping cart, and more gateways.
User account with more detail eg phone, facebook id, post address viewable by admin.

Ad manager similar to facebook, more target setting, users can manage themselves.

Referrals - should all users has been refferred by a person.
Redream activity points.

icons sprites, combine css files to one file, comble javascript to one file.

More with Ajax interface for each block interface. Photo load with lazy loads.
Default design support responsive and mobile table devices.