- 
                Posts2,769
- 
                Joined
- 
                Last visited
- 
                Days Won31
Everything posted by Martijn Geerts
- 
	  Integrating a member / visitor login formMartijn Geerts replied to thetuningspoon's topic in General Support This might get you started: if(!$users->get('tralala')->id) { // If not exists, Null user returned with ID of 0, thus evaluate to false $u = new User(); $u->name = "tralala"; $u->pass = "some-fancy-password-4U"; $u->addRole("guest"); $u->save(); }
- 
	ID's are not meant to be used like that. Better to assign a class if the link has an image & then call the jQuery plug-in. $(function () { $('a[href*="/assets/files/"]:has(img)').addClass('fancy'); $(".fancy").fancybox({ openEffect : 'elastic', closeEffect : 'elastic', ... .. .. credits to Teppo for the $('a[href*=/assets/files/]:has(img)')
- 
	I was searching for array_filter function. ( Don't know why cause I know what it does, stupid me ) The first link was from W3Schools. w3schools.com/php/func_array_filter.asp They state: array Required. Specifies the array to filter callbackfunction Required. Specifies the callback function to use But, the callback function is not required, If no callback is supplied, all entries of array equal to (bool) FALSE will be removed. Beware of W3Schools, this is not the first time I see faulty information. (They only want to make money) end of the warning
- 
	  Prevent data saving for FieldtypeMartijn Geerts replied to Martijn Geerts's topic in Module/Plugin Development I already have the logic in place for all other scenario's, using $value->isChanged('sub-field-name'), The only thing I don't catch right now is the scenario I want to have (prevent save). I will take a look at this. I think you get me started ! Thanks Teppo,
- 
	Right from the docs. ( Languages are well documented ) echo "<ul>"; // remember what language is set to $savedLanguage = $user->language; foreach($languages as $language) { // if user is already viewing the page in this language, skip it if($language->id == $savedLanguage->id) continue; // if this page isn't viewable (active) for the language, skip it if(!$page->viewable($language)) continue; // set the user's language, so that the $page->url and any other // fields we access from it will be reflective of the $language $user->language = $language; // output a link to this page in the other language echo "<li><a href='$page->url'>$language->title: $page->title</a></li>"; } // restore the original language setting $user->language = $savedLanguage; echo "</ul>";
- 
	I'm building a Fieldtype with multiple columns. ( DB structure on the end of the post ) How do I prevent data saving with the API when saving to $page->fieldname and set an wireException ? I only want to allow saving for subfields: $page->fieldname->data_one = 'value1'; (data column will be used for this one) $page->fieldname->data_two = 'value2'; Disallow this: $page->fieldname = 'bad for me'; // DB Structure CREATE TABLE `field_myfield` ( `pages_id` int(10) unsigned NOT NULL, `data` mediumtext NOT NULL, `data_two` mediumtext NOT NULL, `data_int_one` int(11) NOT NULL DEFAULT '0', `data_int_two` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`pages_id`), KEY `data_int_one` (`data_rows`), KEY `data_int_two` (`data_columns`), FULLTEXT KEY `data` (`data`), FULLTEXT KEY `data_two` (`data_one`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
- 
	I would buy a product called "nothing", price $5,- or something. What you recieve: Nothing, nada, niente, rien du tout, niks! (special support)
- 
	ctrl + r Hold the power button for 10 seconds.
- 
	  TextLanguage field problemMartijn Geerts replied to Raymond Geerts's topic in Module/Plugin Development here's a post (I do think you read it) by Chuck Ha, he had a simular error. Not that that change anything yet...
- 
	  TextLanguage field problemMartijn Geerts replied to Raymond Geerts's topic in Module/Plugin Development lol Every field translation is in a separate column, maybe it's comin from there..... So already using 40 key..
- 
	  Strange 403 Forbidden calling the assets/files folderMartijn Geerts replied to Luis's topic in General Support I'm sorry I don't see the full picture (that probably just me). But seeing you overwrite the $user variable rings some alarms on my side.
- 
	  Strange 403 Forbidden calling the assets/files folderMartijn Geerts replied to Luis's topic in General Support Beware of that code Luis, You're overwriting the $user variable. ( could have some side efffects, but didn't read all the posts well enough)
- 
	Every page you want to create on a new line like this: this is a page and this and an other the fourth we continue let's make a few more and again a page this we can use as title etc. ... .. . Save this and import it.
- 
	<blink>There' no difference between <font> or <span> in this/your example:</blink> <marquee>It's bad practise because both font and span methodes have the same problems:</marquee> browser can't cache it difficult to maintain ( code not portable ) Poorly accessible
- 
	It is, but I don't know any mac where you can't access it directly. (alias) in the hosts file you bind the name to the host. the vHosts should pick it up. ( look for servername )
- 
	I will do that URLs at my local environment look like: http://processwire/ http://domainname/ http://testsite/ Here's some content what may help
- 
	I always develop on the same directory level as the site would be when live, so never had to deal with those issues. Every new site has it's own vhost.
- 
	@diogo: Let's drink, n speak some double dutch.
- 
	I'm in for Spaghetti the western kind.
- 
	  Module: Video embed for YouTube/Vimeo (TextformatterVideoEmbed)Martijn Geerts replied to ryan's topic in Modules/Plugins After you installed the Textformatter, go to /site/modules/TextformatterVideoEmbed.module add a line in the methode embedYoutube: // line number +/- 145 $queryString = isset($matches[3][$key]) ? $matches[3][$key] : ''; $queryString = $queryString . "&rel=0"; // this is the new line you should add --- If you make modifications to this module, it's better to rename the module and the file and install it again. This to insures updates won't delete your modifications
- 
	@deh3nne: Welcome !
- 
	  Any recommendations for a org-Chart Library?Martijn Geerts replied to Mr. NiceGuy's topic in Dev Talk I did use use this orgchart once, simple to implement. It converts ul li to a chart. Those charts are generated with Tables.
- 
	How can we miss, welcome flavy ! Have fun playing with ProcessWire.
- 
	Dreams come true ! Big thanks to Antti, Avoine and you Ryan.
 
         
                