Problems, need help? Have a tip or advice? Post it here.
70 posts Page 5 of 7
Previous 1, 2, 3, 4, 5, 6, 7 Next
KK wrote:
Today i use relation many-to-one but this is no good soultion because the user see all the users and must select his user and so the ad gets saved as a relation to that user.

You don't have to give a choice (i.e. show the dropdown) to the user as it is predetermined that the ad would be related to the logged-in user.

You can explicitly set that value directly within the <cms:db_persist_form> tag as follows -
<cms:db_persist_form
_invalidate_cache='0'
_auto_title='1'

ad_owner = k_user_id
/>

The code above assumes that the many-to-one region is named 'ad_owner' and k_user_id contains the ID of the logged-in user. Change them to suit your specific case.


Thanks KK again for helping. Works like a charm :)
Removed!

Attachments

So im having a problem with Securefile!

I have a page using the <cms:editable type='file'> and it seems to give some problem when uploading img with size over 2048px. I get error when trying this!

I check securefile.php in addons and i can see that 2048 is standard so i change this to 5000.

But this will not work, so i try to add max_width='5000' to editable but this will not work!

So anyone had this problem before and have some idea why i cant override this 2048?
kimheggen wrote: Sos im having a problem with Securefile!
So anyone had this problem before and have some idea why i cant override this 2048?

Classic. It has been discussed maybe 10-12 times on forum.
Code: Select all
includes-fileuploader-config        k_max_upload_size 2 to 10
includes-plupload-upload            max_file_size : '10mb',
includes-timthumb                   ini_set('memory_limit', "120M");

Hope it is sufficient to resolve trouble.
After some time now and with my site almost finnished im fixing last bugs to make it all work.

I have made a section where my users can submit info about when they start working and when they are finnished.

And i wanne CALCULATE the difference in HOURS and MINUTTES! Did search here on forum but could not find anything that did this for me. I did try some solutions but no luck.

The user can select DATE YYYY-MM-DD and START time (07:00) and END time (15:00)

Or must i use the DATETIME editable to make the calculation work proper?

Hoping someone have some ideea about this :)
Using datetime editable region would make things a little easier but is not a necessity if you ensure that input is always in the proper format.

As for calculations involving dates, please see the following post - viewtopic.php?f=8&t=8316

It has a list of other related posts at the end. While all should be helpful in giving you an idea as to how to work with dates, there is one post in there that specifically calculates differences between dates.

Hope it helps.
KK wrote: Using datetime editable region would make things a little easier but is not a necessity if you ensure that input is always in the proper format.

As for calculations involving dates, please see the following post - viewtopic.php?f=8&t=8316

It has a list of other related posts at the end. While all should be helpful in giving you an idea as to how to work with dates, there is one post in there that specifically calculates differences between dates.

Hope it helps.


Thanks for quick reply. I did read the posts and did try some but im having trouble calculate the TIME, the date is not a problem. But i a user select 07:00 as start time and 15:00 as end time the calculation only show 00:00. I was trying the spessific post about CALCULATE DIFFERENT BETWEEN DATE!
kimheggen wrote: calculate the TIME, the date is not a problem. But i a user select 07:00 as start time and 15:00 as end time the calculation only show 00:00. I was trying the spessific post about CALCULATE DIFFERENT BETWEEN DATE!


Kim, I used conversion to seconds in Unix format. Since both dates are in seconds, then you can perform operations on them. Check my samples I used in other project:
Code: Select all
    <cms:set current_date = "<cms:date format='Y-m-d H:i:s' />" scope='global' />
    <cms:set plus_one_hour = "<cms:php>echo date('Y-m-d H:i:s',<cms:add "<cms:date format='U' />" '3600' />);</cms:php>" scope='global' />

I hope you can figure it out. PM for a customized solution.
trendoman wrote:
kimheggen wrote: Sos im having a problem with Securefile!
So anyone had this problem before and have some idea why i cant override this 2048?

Classic. It has been discussed maybe 10-12 times on forum.
Code: Select all
includes-fileuploader-config        k_max_upload_size 2 to 10
includes-plupload-upload            max_file_size : '10mb',
includes-timthumb                   ini_set('memory_limit', "120M");

Hope it is sufficient to resolve trouble.


Hi,

Sorry for late reply! I did make changes on all the places BUT still im getting error.

Code: Select all
includes-fileuploader-config        k_max_upload_size 2 to 10 - I set to 10
includes-plupload-upload            max_file_size : '10mb', - I set to 10mb
includes-timthumb                   ini_set('memory_limit', "120M"); - I change from 60 to 120


Anyone? Like you say it is discussed 10-12 times but still not any of them is or have a good answer to this problem!
Hope it is sufficient to resolve trouble.

Well, if it's still there, we'll find another solution for file uploads :)
Previous 1, 2, 3, 4, 5, 6, 7 Next
70 posts Page 5 of 7
cron