i'm building my really first module (i'm not a developer) and i would be grateful to anyone that could help me.
As is my firs attempt, please forgive me any error or stupid things; i'll try to clearly explain what the module do and what it should do, please feel free to answer and suggest anything you might consider useful to get deeper.
The module (actually a simple one) lets a block send sms to authenticated_user loading the page where the block is shown (if he/she has checked the option in the edit profile page).
Here is what i wrote down
<?php
/**
* hook_block().
*/
function sendsms_block($op = 'list', $delta = 0, $edit = array()) {
if ($op == 'list') {
$blocks[0]['info'] = t('Send sms ');
return $blocks;
}
else if ($op == 'view') {
//Function invio() to send sms and output a defined text. Much much more work to do!
function invio()
{
global $user;
profile_load_profile($user);
$destination_number=$user->{profile_mobile};
$message_body=($user->name) . ", your sms sent. KeyId: ". randomkeys(6) ." -- staff.mysite.com";
if (isset($user->{profile_mobileok})&&($user->{profile_mobileok})=='1') {smsgateway_sendmessage( $destination_number, $message_body); $s='Sms delivered.' ; return $s; }
elseif (($user->{profile_mobileok})=='0') { $t='you have to edit your profile to get sms.'; return $t ; }
}
switch ($delta) {
I'm working on a module which requires different files to be loaded into a page depending on the plugin version selected in the module settings page. A dropdown list seems to be the best way to go, can anybody give me a hand on setting a default variable and how the module can change the variable.
My problem: I wish to create Views of my nodes filtered and sorted by categories (from category table) rather than taxonomy vocabulary terms. The Views module only sees vocabulary terms (even with category_views, which depends upon taxonomy wrapper to create a "mirror" of categories as terms). I can't use taxnonomy wrapper because it appears to break OG forums.
I noticed there is a .htaccess file in the ~/files directory. If I don't alter the .htaccess file I get server errors trying to download/view attachments. I deleted the .htaccess file and was able to successfully view/download attachments.
However when I uploaded another attachment the .htaccess came back. I figure this must be part of the internal workings of the module. With the return of .htaccess came the server error when viewing/downloading the attachment.
I'm working on a site with multiple languages. When I have both french and english enabled, a great deal of the site remains in english. However when the english is disabled... it's able to cope as a nearly-fully french site. This says to me that the translation strings are around, but are not being called whenever the english module is in.
I want to group by users by location -- e.g. San Francisco Bay Area, New York City. I see on some other sites where only zip code and country is collected for the user, but the information displayed is by city (eg New York City). Is there any Drupal module that can do this?
I looked at location module before but it seems like it didn't do it. There were some interesting threads about this, but I'm not aware of anything that was finished.
There might be modules or work-in-progress I missed. Your comments appreciated.