Skip to Content

Newsfeeds

2bits: Configuring Apache Solr 4.x for Drupal, with password authentication

Planet Drupal - 12 May 2014 - 12:34pm
Most of high traffic or complex Drupal sites use Apache Solr as the search engine. It is much faster and more scaleable than Drupal's search module. In this article, we describe one way of many for having a working Apache Solr installation for use with Drupal 7.x, on Ubunutu Server 12.04 LTS. Objectives For this article, we focus on having an installation of Apache Solr with the following objectives: Use the latest stable version of Apache Solr

read more

Categories: Drupal

AGLOBALWAY: Drupal CKEDITOR configuration to work with bootstrap theme

Planet Drupal - 12 May 2014 - 11:55am

Drupal and Bootstrap theme are awesome, but when it comes to use ckeditor you can loose some nice framework styles and it can break your responsive website by adding a simple image or table. One of the ways of fixing it is using a simple configuration to extend and adjust ckeditor.

Adding Boostrap Components to your ckeditor styles and adding extra configuration to ckeditor.config.js

Before we start copy the sites/all/modules/ckeditor/ckeditor.styles.js and sites/all/modules/ckeditor/ckeditor.config.js file into your theme directory (themes/bootstrap/), and enable them in your ckeditor profile (in CSS tab Predefined styles chose “Define path to ckeditor.styles.js” and change Predefined styles path to “%t/ckeditor.styles.js” and in ADVANCED OPTIONS tab check Load ckeditor.config.js from the theme path to yes). You will need to also enable “styles” menu in your ckeditor toolbar and you may want to use your theme styles to preview ckeditor styles before saving your content.

  1. Open your ckeditor.styles.js, and comment or remove all useless styles. if(typeof(CKEDITOR) !== 'undefined') { CKEDITOR.addStylesSet( 'drupal', [ ]); }

    You should have something like this

  2. 2. Copy new bootstrap styles in your ckeditor.styles.js. And save the file /* Bootstrap Styles */ /* Typography */ { name : 'span.H1' , element : 'span', attributes: { 'class': 'h1' } }, { name : 'span.H2' , element : 'span', attributes: { 'class': 'h2' } }, { name : 'span.H3' , element : 'span', attributes: { 'class': 'h3' } }, { name : 'span.H4' , element : 'span', attributes: { 'class': 'h4' } }, { name : 'span.H5' , element : 'span', attributes: { 'class': 'h5' } }, { name : 'span.H6' , element : 'span', attributes: { 'class': 'h6' } }, { name : 'Paragraph Lead' , element : 'p', attributes: { 'class': 'lead' } }, { name : 'Unstyled List', element : 'ul', attributes : { 'class' : 'list-unstyled' } }, { name : 'List inline', element : 'ul', attributes : { 'class' : 'list-inline' } }, { name : 'Table', element : 'table', attributes : { 'class' : 'table' } }, { name : 'Table Striped rows', element : 'table', attributes : { 'class' : 'table table-striped' } }, { name : 'Table Bordered', element : 'table', attributes : { 'class' : 'table table-bordered' } }, { name : 'Table Hover rows', element : 'table', attributes : { 'class' : 'table table-hover' } }, { name : 'Table Condensed', element : 'table', attributes : { 'class' : 'table table-condensed' } }, { name : 'Image shap rounded', element : 'table', attributes : { 'class' : 'img-rounded' } }, { name : 'Image shap circle', element : 'table', attributes : { 'class' : 'img-circle' } }, { name : 'Image shap thumbnail', element : 'table', attributes : { 'class' : 'img-thumbnail' } }, { name : 'Image float left', element : 'table', attributes : { 'class' : 'pull-left' } }, { name : 'Image float right', element : 'table', attributes : { 'class' : 'pull-right' } },
  3. Open your ckeditor.config.js, search for “config.justifyClasses” and replace it with this line: config.justifyClasses = [ 'text-left', 'text-center', 'text-right', 'text-justify' ];

    This will change default text alignment classes to new bootstrap classes

  4. At very bottom of ckeditor.config.js, copy and paste this lines. CKEDITOR.on('dialogDefinition', function( ev ) { var dialogName = ev.data.name; var dialogDefinition = ev.data.definition; if(dialogName === 'table' || dialogName == 'tableProperties' ) { var infoTab = dialogDefinition.getContents('info'); //remove fields var cellSpacing = infoTab.remove('txtCellSpace'); var cellPadding = infoTab.remove('txtCellPad'); var border = infoTab.remove('txtBorder'); var width = infoTab.remove('txtWidth'); var height = infoTab.remove('txtHeight'); var align = infoTab.remove('cmbAlign'); } if(dialogName === 'image') { var infoTab = dialogDefinition.getContents('info'); dialogDefinition.removeContents( 'Link' ); dialogDefinition.removeContents( 'advanced' ); infoTab.remove('txtWidth'); infoTab.remove('txtHeight'); infoTab.remove('txtBorder'); infoTab.remove('txtHSpace'); infoTab.remove('txtVSpace'); infoTab.remove('ratioLock'); infoTab.remove('cmbAlign'); } });

    This will remove default inline styles like a width and height from image/table configuration popup.

Reference:
https://drupal.org/project/bootstrap

Tags: drupaldrupal planet
Categories: Drupal

With UNET, Unity aims to make online multiplayer easier for devs

Social/Online Games - Gamasutra - 12 May 2014 - 11:29am

The folks at Unity published a blog post today outlining their plans to revamp Unity's online multiplayer support as part of an internal project codenamed UNET -- Unity Networking. ...

Categories: Game Theory & Design

Get Pantheon Blog: Moving MySQL tables from MyISAM to InnoDB

Planet Drupal - 12 May 2014 - 10:00am

One of the greatest things ever to happen to MySQL was the InnoDB engine. Before InnoDB, indexes would get corrupted, updates meant table locks, not just row locks, and we had no support for transactions. Since the advent of InnoDB however, we've come a long way. These days, most serious DBAs using MySQL build exclusively on the InnoDB engine.

Sadly though, many sites are still using the MyISAM engine. Some are hosted on shared hosting servers and some just don't have a proper DBA to look after their databases. For whatever the reason, these sites are missing out on the performance and stability gains that the rest of us take for granted. At Pantheon, we know there are a lot of these sites out there because we see them when they migrate their sites onto our platform. As part of our Launch Check, we check the engine type on every table. If we find a table using the MyISAM engine, we notify the user so they can fix it.

Fixing this problem is simple to any developer who understands a little SQL. However, for non-developers, this can be a daunting task. So I have put together a little PHP script to help you convert your MyISAM tables to InnoDB.

NOTE: This is an unofficial script. It is not supported by Pantheon. Customer Support will not help you run it, nor will they hold your hand while fixing things if this script screws up your database. Use THIS SCRIPT AT YOUR OWN RISK. I strongly suggest you make a backup of your database before running this script. 

The Easy Way

Still with me? Cool! Let's dive right in. 

There are 2 versions of this script. One is meant to be called from a web browser. It is meant for Pantheon customers. If you are a Pantheon customer, save the code in a file with the extension .php and sftp it up to your site. Place it in the code directory of your website.

Now, point a browser to your newly created script that should be in the root directory of your Dev environment.

http://your.dev.url.gotpantheon.com/filename.php

That is all there is to it. The script will do all the work. You don't need to change anything.

Here is the browser version of the script:

The Developer Way

If you are not a Pantheon customer, or you want to run the script from the command line, use the one below. To use this one however, you need to know two things before you begin.

  1. You have to have PHP installed on the computer you want to run this on. I run this on my laptop. I have PHP installed on my laptop. I know that because I can type php -v at the command line and I get a proper response. If you do not understand any of that, this script is not for you, use the one above.
  2. If you are a Pantheon customer, you can get your database connection info from your site's dashboard. Make sure you get the information for your Dev environment. After you've run the script, and everything looks good, you can easily migrate it up the line to Test and then Live. If you are running this on your site and your site is not on Pantheon, you will have to find another way to get your MySQL connection info.

Here is the command line script:

See the line that says "* DO NOT CHANGE ANYTHING BELOW THIS LINE"? I'm serious about that. If it doesn't' work and you are not a programmer, don't mess with it. If you are a programmer, you realize exactly how dead-simple the script is.

Here are the parameters you will need to configure before running the script.

  • host = This is the name of the machine your db is running on. If you are a Pantheon customer localhost is WRONG. Get the correct host and paste it in there replacing localhost. 
  • port = This is the port that is running MySQL on your computer. Again, if you are a Pantheon customer, we give you this information. If you are not, 3306 is the standard port for MySQL. 
  • user = This is the user name you use to connect to MySQL with. 
  • password = This is your MySQL password for the user you specified in the line above.
  • database = This is the name of the database that contains the tables. If you are a pantheon customer, this is "pantheon". If you are not a Pantheon customer, you will need to get this from your host.

Now, save the file.

Then from a command window execute the program. (How you get a command window varies by OS. If you don't know, ask your computer friend, younger sibling, or niece.)

The script will tell you everything it is doing. It has safeties built in to keep it from changing anything by MyISAM tables. It will look at every table in your database and if the engine is MyISAM, it will change it to an InnoDB.

Once you have run it successfully, check everything! 

This is not a particularly dangerous script. The change is pretty simple. However, it's your data. So be careful. 

Blog Categories: Engineering
Categories: Drupal

drunomics: #d8rules - Supporting the Rules modules for Drupal 8

Planet Drupal - 12 May 2014 - 9:12am

Today, I've the pleasure to introduce the #d8rules initative, our combined effort to get the Rules module ported to Drupal 8 in time!

Drupal 8 is coming...

Fortunately, the first beta of Drupal 8 is coming closer so it's time to make sure all the modules are ported and ready for Drupal 8. Unfortunately, the Rules module - my long term number one contributed module - is about to be left behind. I've worked a lot on Drupal 8 to get critical Entity API improvements like the new Entity Field API (called Entity Property API at the time of the introduction) as well as the new Typed data API done. Of course, the work on core is time intensive, not "done" yet and won't stop - so there is not a lot contribution time left for my contributed modules. :/

So where is Rules for Drupal 8 now?

In short, it's not there yet. While quite a bit of work under the hood and planning has been done already, the main work - porting of the module itself - is still to be done. As Drupal 8 ships with quite a bunch of important improvements, this requires the rewrite of significant parts of the module. In Drupal 7, the Rules module had to solve a lot of hard problems like handling its configuration, configuration translation, dependency tracking, integrity checks and plugins, which all have solutions in Drupal 8 core now. That's awesome, but it requires us to adapt the previous Drupal 7 solutions to work inline with Drupal 8 best practices. However, more than that - the foundational metadata Rules needs is already there as well!

The foundation is (mostly) there

In Drupal 7 the creation of the Entity API module, in particular its Entity Metadata wrappers and the backing Entity Property Information, was driven by the needs of the Rules module. While the Rules module makes it simple to work with data for site builders, the Entity module makes it simple for developers first. Subsequently, the Rules module can build upon the easy API and make it accessible via the rule model and its UI. For Drupal 8, the Entity Field API and its underlying Typed Data API are that easy API upon which the Rules module can build upon. That's great, as it means we have the foundation we can build upon in place - but again, it changed (improved) substantially and will require us to adapt a lot of what's there. However, having the Typed Data API and all the necessary metadata built-in means that the out of the box module and entity type support of Rules for Drupal 8 will be substantially better as well.

Actions and conditions in core

We've got an Actions and Conditions API in core already, so one might think another huge part has been taken care off. Unfortunately, no - those APIs have been created/ported with other use cases in mind, so they do not cater for all the more advanced features Rules users are used to. While I tried to make sure they fit Rules needs as far as possible when they were introduced/updated, they do not fit our needs yet and it might be impossible to make them fit without breaking those APIs. For Rules 8.x we plan to work on improving those APIs (from contrib) as needed first, so we can ensure they fit Rules' requirements. Once we are sure everything works out we'll know what we have to adapt and whether improvements can be contributed to core. Depending on how that works out, we'll see whether we can build up on the core Action and Conditions API or there will be Rules' variants of those APIs (again :(). For more details please see the related issues:

We have a plan

We've quite some work to do to get Rules ported to Drupal 8. klausi and me estimated the task to be additional 1050 hours work (from here). With us, working on it in our spare time besides our other contributions (Entity Field API, Rest module in core, ..) we figured the module won't be ready before sometime in 2015, not unlikely even 2016. That's obviously too late, so we'd love to invest more of our time and work on it during work hours as well, such that we can deliver a ported version in 2014. Our companys cannot afford taking that investment alone, but are up for supporting us and enable us to work on a community rate of € 45/h net cost for the project. You can find more details on the project plan and estimations on our initative site.

Rules needs your help!

If you think the Rules module is a valuable tool and helps you building sites faster, please consider supporting our iniatitive! There is a limited goodie for the 50 first supporters pledging >65$ - check it out. If you are going to Drupalcon Austin and you'd love to help, consider signing up for the #d8rules sprint! We'll get started porting either events, conditions or actions to the new API. Lastly, please help to spread the word! We've got supporter badges that you can embed on your site, and obviously our hash tag is #d8rules!

Video of #d8rules

 

Resources

Iniative website: http://d8rules.org
drupalfund.us campaign: https://www.drupalfund.us/project/d8rules-support-rules-module-drupal-8
Project page: http://drupal.org/project/rules

Categories: Drupal

Stanford Web Services Blog: Module of the Day: JS Injector

Planet Drupal - 12 May 2014 - 9:09am

Today's "Module of the Day" is a handy little module called JS Injector that allows you to insert snippets of Javascript into your site.

In this post, I'll walk through how to enable and configure the module, use it to shout, "Hello, World!", and then go into some more advanced configuration.

Categories: Drupal

A tool to assess your leadership effectiveness

Social/Online Games - Gamasutra - 12 May 2014 - 6:04am

"A medium-exhaustive collection of leadership topics" that you can rate yourself on -- or even use as a tool within your studio -- to assess where you rank as a leader and what you need to improve. ...

Categories: Game Theory & Design

I Want to See Less Realistic Videogame Graphics! - by Brandon Perton

Gamasutra.com Blogs - 12 May 2014 - 1:33am
This is not to say that I don’t want any games that are more realistic than current games. But I think the game industry—and the consumers whom that industry is trying to please—need a greater awareness that increased visual realism...
Categories: Game Theory & Design

The ups and downs of doing online multiplayer as an indie

Social/Online Games - Gamasutra - 12 May 2014 - 1:04am

Including online multiplayer is a difficult task, particularly for small teams. We speak to indies who've been in the trenches to get their take. ...

Categories: Game Theory & Design

Building for Unity - The Roof - by Amir Barak

Gamasutra.com Blogs - 12 May 2014 - 12:26am
In which we generate some actual project files for Visual Studio consumption, put all the pieces together and I finally finish writing about this crazy ride of a build process. Onwards! To greener pastures!
Categories: Game Theory & Design

The decision to go free-to-play or pay-to-play in MMOs is all business - by Ken Serra

Gamasutra.com Blogs - 12 May 2014 - 12:20am
So what IS the difference, from a business perspective, between a free-to-play and subscription-based MMO? Find out!
Categories: Game Theory & Design

Web Omelette: Sending HTML Emails with Webform in Drupal 7

Planet Drupal - 12 May 2014 - 12:12am

Have you ever wondered how you can include HTML markup in the emails you send with Webform? Out of the box, you cannot. But I am going to show you a simple way to achieve this using the Mime Mail module and some simple theming. Additionally, I will show you how to control which webforms should send HTML emails and which should not.

First though, make sure you install and enable the Mime Mail and Mail System modules (the latter is a dependency of the former). With Drush, all you have to do is use this command:

drush en mimemail -y

It will take care of all you need to do. If you commit the module to your repo, don't forget that the Mail System module also gets downloaded, so make sure you include it as well.

Next, edit your theme's template.php file and paste this block of code (explained after):

function your_theme_webform_mail_headers($variables) { $headers = array(); $headers = array( 'Content-Type' => 'text/html; charset=UTF-8; format=flowed; delsp=yes', 'X-Mailer' => 'Drupal Webform (PHP/'. phpversion() .')', ); return $headers; }

Make sure you change your_theme with the name of your theme. So what happens here? We override the theme_webform_mail_headers() declared by the Webform module. We do this in order to add a content type to the mail headers, and set it to HTML. And that's pretty much it.

If you now clear your caches and test a webform, you'll see that you can add anchor tags and other basic HTML tags.

One problem you might run into though is that all your webforms are now sending emails in HTML format - a result only partially desired. You'll notice that the default email that you send no longer provides any spacing and all the text gets put on one line - as HTML in fact.

So what you can do is make a selection of webforms for which you'll want HTML emails. A handy way of doing this is by adding a field to your webform content type that will be used to swith HTML emails on/off for a given node. So to illustrate this, let's say we added a new field to the relevant content type called HTML Emails (with the machine name: field_html_email). This field is a boolean type (a single checkbox basically) with the values of 1 for on and 0 for off.

It follows to adapt the theme override above and replace it with something like this:

function your_theme_webform_mail_headers($variables) { $headers = array( 'X-Mailer' => 'Drupal Webform (PHP/' . phpversion() . ')', ); // Get the HTML Email field $html_email_field = field_get_items('node', $variables['node'], 'field_html_email'); // Check if this webform node needs to send HTML emails if (!empty($html_email_field)) { $html = $html_email_field[0]['value'] == 1 ? TRUE : FALSE; } if ($html === TRUE) { $headers['Content-Type'] = 'text/html; charset=UTF-8; format=flowed; delsp=yes'; } return $headers; }

If you consult the documentation for this theme function, you'll know that the $variables parameter contains also the node object which uses Webform to send the email. So we basically check for the value of our field and if it is 1, we add the HTML information to the mail headers. Otherwise, we return the $headers array containing the value it does by default (essentially making no changes).

You can now clear the caches and test it out. Edit a node of the respective content type and check the box. You'll see that it now sends HTML emails. However, if you uncheck the box, it will fallback to the default format that comes with the Webform module.

Hope this helps.

In Theming | Drupal var switchTo5x = true;stLight.options({"publisher":"dr-8de6c3c4-3462-9715-caaf-ce2c161a50c"});
Categories: Drupal

A Tale of Two Activisions - by S Gregory Boyd

Gamasutra.com Blogs - 12 May 2014 - 12:08am
Will the real Activision please stand up? A patent troll can also be a trademark troll as we find out with one particular company threatening patent litigation and attempting to fool target companies into believing that it was really named Activision.
Categories: Game Theory & Design

Fuzzy Thinking: Collect Call of Cthulhu

RPGNet - 12 May 2014 - 12:00am
Pick up the phone!
Categories: Game Theory & Design
Syndicate content


Google+
about seo