Creating a Drupal Module is easy! At the minimum, you only need two files; a .info file, which describes our module and a .module file, which is where most of our code goes.
First things first, you need to create a folder to place our two files in. Call it my_module and place it in sites/all/modules (I place mine in sites/all/modules/custom).
Saturday, May 9, 2015
Pass JSON To Drupal Page
I worked on a complex javascript application that comprised of many checkboxes, textfields, dropdowns and multiple steps. The data needed to be stored in a database and since I didn't use Drupal's Ajax, I needed to pass the data asynchronously elsewhere for that to be handled.
Saturday, February 28, 2015
View Exposed Filter with a dropdown/select and textfield
In this example, we'll edit the commerce orders view. We need to edit the exposed filters in the view's configuration so we can then modify it programmatically and add more form elements. Without a preexisting exposed filter, there won't be a form to modify.
Sunday, June 8, 2014
Freelancer Drupal Exam (some questions)
If you're like me before taking an exam, you probably like to get an idea of what questions will be in it. As far as the Drupal Exam, I found nothing. I hope this post will help some people. I'm only posting the first 12 questions (keep in mind the exams are random). I do need to take the exam again if I want a better score, so more questions may be posted later.
Thursday, March 20, 2014
Drupal Commerce Bulk Order Printing
You will need to download and enable Views Bulk Operations and Commerce Invoice Receipt for this solution. This also assumes you know how to create a basic module.
Thursday, November 7, 2013
Drupal Views Related Products
This method requires Views PHP in order to select the appropriate products.
There are many articles on this, but none worked perfectly for me, so I'm writing the steps I took.
There are many articles on this, but none worked perfectly for me, so I'm writing the steps I took.
Tuesday, October 29, 2013
Commerce Product Bundle: link to product fix
Link to original issue: https://drupal.org/node/1668100.
This issue took me days to find. It just didn't make sense, but once I found the underlying problem, the solution was pretty simple.
This issue took me days to find. It just didn't make sense, but once I found the underlying problem, the solution was pretty simple.
Saturday, May 4, 2013
Saturday, July 3, 2010
Looting script for ultima online
This is one of my favorite scripts I've written. You will get many types of feedback when using this script in a crowd such as...
I've only used this script on free shards. Also, I wrote this a while ago, so I'm sure some improvements can be made. Test it out and leave some comments. If you have some suggestions, questions or anything, let me know. Thanks!
This script is set to loot a corpse when you hit the "F6" key. You can change the key by editing the %lootkey variable.
I've only used this script on free shards. Also, I wrote this a while ago, so I'm sure some improvements can be made. Test it out and leave some comments. If you have some suggestions, questions or anything, let me know. Thanks!
This script is set to loot a corpse when you hit the "F6" key. You can change the key by editing the %lootkey variable.
;====================================
; Script Name: Anon J's Super Looter. :)
; Author: Anon J
; Version: 1.1
; Shard OSI / FS: FS
; Revision Date: 2008/03/11
; Purpose: Loot bodies faster than a human.
;=====================================
;**************Variables***************
set %priority POF
set %items EVF_HVF_VVF_ZVF_RVF_GVF_NVF_BVF_UVF_KUF_JUF_KZF_JZF_RZF_MZF_WZF_SZF
set %lootkey F6
set %hotbag #CHARID
;event macro 8 1
;gosub waitfor 262_324 3
;sleep 500
;contpos 583 -193
;sleep 500
;***********Main Loop**************
loop:
onhotkey %lootkey
gosub loot
goto loop
;==================Loot sup=================
sub loot
finditem YFM_VNF_LNF_WNF G_1
if #findcnt > 0
{
set %corpse #findid
set #lobjectid %corpse
set %looting 1
}
if #findcnt < 1
{
ignoreitem reset
finditem YFM_VNF_LNF_WNF
if #findcnt < 1
return
}
event macro 17 0 ;last object
gosub waitfor 144_212 3
sleep 100
while %looting = 1
{
onhotkey %lootkey
set %looting 0
;loot priority item first
finditem %priority C_ , %corpse
if #findcnt > 0
{
exevent drag #findid #findstack
sleep 100
exevent dropc %hotbag
sleep 100
}
finditem %items C_ , %corpse
if #findcnt > 0
{
exevent drag #findid #findstack
sleep 100
exevent dropc %hotbag
sleep 100
ignoreitem #findid
}
else
set %looting 0
}
ignoreitem %corpse
return
;**********wait for sub*************
sub waitfor
set %time #time + %2
while %time >= #time
{
if #contsize = %1
return #true
sleep 100
}
return #false
Subscribe to:
Posts (Atom)