drupal.org - Module development http://drupal.org/taxonomy/term/4/0 For assistance with module development. en font visualization problem http://drupal.org/node/515516 <p>Hi,<br /> I need to insert in my book page some text with phonetic character (in particular I'm referring to Silipa font).<br /> The problem is that people who don't have in your computer this font installed, aren't able to correctly read the text in your browser.</p> <p>How can I resolve this problem?<br /> Many thanks.<br /> All the best, Vivi</p> http://drupal.org/node/515516#comments Module development Drupal 6.x Fri, 10 Jul 2009 10:35:49 +0000 vivi 515516 at http://drupal.org Created Module and Menu Items http://drupal.org/node/515462 <p>Hi,</p> <p>a couple of questions on module development which I can't get my head around...</p> <p>I'm adding in a couple of administration features for my module, so I currently have the following items added...</p> <p><div class="codeblock"><code>function mymodule_menu() {<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; $items = array();<br /><br />&nbsp;&nbsp;&nbsp; $items[&#039;admin/content/option1&#039;] = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#039;title&#039; =&gt; &#039;Option 1&#039;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#039;description&#039; =&gt; &#039;Description for option 1.&#039;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#039;page callback&#039; =&gt; &#039;mymodule_option1&#039;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#039;access arguments&#039; =&gt; array(&#039;administer mymodule&#039;),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#039;type&#039; =&gt; MENU_NORMAL_ITEM,<br />&nbsp;&nbsp;&nbsp; );<br />&nbsp;&nbsp;&nbsp; $items[&#039;admin/content/option2&#039;] = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#039;title&#039; =&gt; &#039;Option 2&#039;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#039;description&#039; =&gt; &quot;Description for option 2.&quot;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#039;page callback&#039; =&gt; &#039;mymodule_option2&#039;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#039;access arguments&#039; =&gt; array(&#039;administer mymodule&#039;),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#039;type&#039; =&gt; MENU_NORMAL_ITEM,<br />&nbsp;&nbsp;&nbsp; );<br /><br />&nbsp;&nbsp;&nbsp; return $items;<br />}</code></div></p> <p>This of course makes the items appear under Content Management. What would I have to add to make them appear under their own menu grouping, i.e. Administration -&gt; MyModule -&gt; Option 1 and Administration -&gt; MyModule -&gt; Option 2.</p> <p><a href="http://drupal.org/node/515462" target="_blank">read more</a></p> http://drupal.org/node/515462#comments Module development Drupal 6.x Fri, 10 Jul 2009 09:19:35 +0000 KeithHurst 515462 at http://drupal.org http://nimfahtography.com/ http://drupal.org/node/515384 <p>which module is used for this photo gallery(categorised photo gallery)</p> http://drupal.org/node/515384#comments Module development Drupal 6.x Fri, 10 Jul 2009 06:54:25 +0000 Nada Abou Dehn 515384 at http://drupal.org How to list nodes according to content types for a particular term in drupal? http://drupal.org/node/515364 <p>Hi,</p> <p>I want to display nodes according to content types in drupal.<br /> Actually I want this:</p> <p>1) I have a vocabulary "categories" with a term "Arts and Entertainment".<br /> 2) I want to associate two content types "Articles" and "How-tos" with that vocabulary.<br /> 3) I want to show a "tab" or a "block" on term "Arts and Entertainment" page so that users can easily view list of nodes related to "Articles" or "How-tos" by selecting (clicking) a particular option from the block or tab. It is better if I can list all nodes by default. So, in such case there should be three options "All", "Articles", and "How-tos".</p> <p>Can anyone tell me how to do this? If I will have to make a seperate block for all term pages it is still acceptable by me. Please help me.</p> <p>Thanks in advance<br /> DIMSKK</p> http://drupal.org/node/515364#comments Module development Drupal 6.x Fri, 10 Jul 2009 05:52:40 +0000 DIMSKK 515364 at http://drupal.org help with access permissions http://drupal.org/node/515300 <p>hi</p> <p>I have created a module and I am having trouble with permissions..</p> <p>heres what I wanted to achieve.</p> <p>I have created a parent item and a child item</p> <p> Super Module<br /> + Child Module</p> <p>On my Super Module and Child Module admins could access them. </p> <p>What I wanted is to restrict the Super Module to regular users,<br /> regular users are only allowed to access Child Module..</p> <p>I've tried using the _perm hook and used 'administer' and 'access' then tried different combination<br /> but I didnt manage to achieve what i wanted.</p> <p>thanks!</p> http://drupal.org/node/515300#comments Module development Fri, 10 Jul 2009 03:48:22 +0000 superpaul 515300 at http://drupal.org userpoints_badges http://drupal.org/node/515134 <p>Has any one found a good alternative for userpoints_badges module for drupal 5.x?<br /> Thanks.</p> <p><code>Edited by WorldFallz - moved to appropriate forum.</code></p> http://drupal.org/node/515134#comments Post installation Drupal 5.x Thu, 09 Jul 2009 22:30:50 +0000 tmandava 515134 at http://drupal.org Howto secure provide files to single users only? http://drupal.org/node/515126 <p>I like to store system generated files to individual users only.<br /> So the files are only accessible by that one user.</p> <p>So how and where do I store the files and how grant I access for the users?</p> <p>I didn't find any examples yet.</p> <p>Thanks,<br /> Ingo</p> http://drupal.org/node/515126#comments Module development Drupal 5.x Thu, 09 Jul 2009 22:26:45 +0000 ingox 515126 at http://drupal.org Database user table specs http://drupal.org/node/515120 <p>I'm trying to find a reference that provides the purpose of each field in the user table -- anyone know where to find it? API reference for user_load provides no information on the $user object structure...</p> http://drupal.org/node/515120#comments Module development Drupal 5.x Thu, 09 Jul 2009 22:20:31 +0000 pkrecker 515120 at http://drupal.org Why Won't My Module Use It's Template File?? http://drupal.org/node/515004 <p>Hey guys,</p> <p>I'm writing a module that renders a block. My problem is that I can't seem to get the module to use the template file the way I want it do. I have this in the module:</p> <p><div class="codeblock"><code>function myModule_theme() {<br />&nbsp; return array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#039;myModule_banner&#039; =&gt; array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#039;arguments&#039; =&gt; array(&#039;banners&#039; =&gt; array()),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#039;template&#039; =&gt; &#039;myModule-banner&#039;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ),<br />&nbsp;&nbsp;&nbsp; );<br />}</code></div></p> <p>It's picking the hook up, because I can see it (and the proper template reference) in the theme registry.</p> <p>Then I'm using the hook_block function to do the processing for the block. I guess I'm a little confused as to how to reference the theme function. If at the end of the hook_block function, I use:</p> <p><code>$block[&quot;content&quot;] = &quot;It works!&quot;;</code></p> <p>...then I get "It works!" rendering where the block should be. However, if I do:</p> <p><code>$block[&quot;content&quot;] = theme(&quot;myModule_banner&quot;, $banner); // where $banner is an array of data I want to pick up in the template file</code></p> <p>...then it never even calls the theme file. It renders a blank block, and no matter what I var_dump or whatnot in myModule-banner.tpl.php file nothing ever shows up (I have a mix of var_dump and HTML, so SOMETHING should show if it was calling the template file at all).</p> <p><a href="http://drupal.org/node/515004" target="_blank">read more</a></p> http://drupal.org/node/515004#comments Module development Drupal 6.x Thu, 09 Jul 2009 19:31:14 +0000 nrutman 515004 at http://drupal.org Drupal pain.. Trying to create 2 registration forms- Forms API, or CCK ? and does email work http://drupal.org/node/515002 <p>A BASIC need is to have more than one registration form for different types of users. In my site I need a registration for MERCHANTS and one for CONSUMERS. After pawing around the forums and seeing conflicting advice, I think I am going to try autoassignroles and content profile 'developer' modules. As I understand you need to do the following:</p> <p>Make roles for example: "student" and "professor".<br /> Make 2 content types, "Student personal data" and "Professor personal data". In those content types check "Use this content type as a content profile for users". Then tab "Content profile" will show up. In that tab check "Use on Registration" and choose for witch role.<br /> Go on autoasigne role page. Click on "Asign from path". And fill the path field for each role for example : register/student for students.<br /> And that is all.<br /> Now you have 2 url addresses , one for each role, with different form fields for registration.</p> <p>IS That correct? And if so, do I create the content types using forms API? And if so, does the emailing back to the registered user work? How? Don't I need to put an email address in my form and somehow TELL the registration ?</p> <p>This seems like such a basic need and I've spent 3 days on it! Drupal is NOT fun.</p> http://drupal.org/node/515002#comments Module development Drupal 6.x Thu, 09 Jul 2009 19:30:12 +0000 binjaja 515002 at http://drupal.org Affililiate comparison http://drupal.org/node/514942 <p>I tried to download 5.x-1.x-dev and it said it was not compatible with my version. 6.10.<br /> Does anyone know what version it is compatible with or if there is another module that does the same thing?<br /> Thank you</p> http://drupal.org/node/514942#comments Module development Drupal 6.x Thu, 09 Jul 2009 18:07:25 +0000 daforuiner 514942 at http://drupal.org How can I remove the link (ul) "Create a new Blog entry" which appears above the blog http://drupal.org/node/514940 <p>Hi guys</p> <p>I've got a problem.<br /> I woudl like to remove the link called "Create a new Blog entry" from the BLOG<br /> Or I woudl like to add an div containder or a class which would format this link.</p> <p>THe problem is that the main class is called item-list and if I format this with css then other links in other UL would be formatted too.</p> <p>I would like to add a format ONLY to this link.</p> <p>So how can I do this or where I can find the code (maybe in blog blog.module file???) releated to this link?</p> <p>Cheers</p> http://drupal.org/node/514940#comments Module development Drupal 6.x Thu, 09 Jul 2009 18:06:19 +0000 Drake 514940 at http://drupal.org why does user_delete() delete content while GUI does not? http://drupal.org/node/514918 <p>Hi,</p> <p>I use user_delete() in one of my modules, and discovered that all <strong>content</strong> of the deleted user is deleted as well. Why does this happen?</p> <p>When using the GUI (at administer-&gt;users) to delete a user, the user_delete() function is also called, but the content of that user stays and gets reassigned to the anonymous user. This is what I want.</p> <p>I call user_delete() this way:</p> <p><div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$user </span><span style="color: #007700">= </span><span style="color: #0000BB">user_load</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'name' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'test'</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">user_delete</span><span style="color: #007700">(</span><span style="color: #0000BB">null</span><span style="color: #007700">,</span><span style="color: #0000BB">$user</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">uid</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div></p> <p>The first argument is probably my problem. What do I need to put there in order to prevent deletion of the user's content?</p> http://drupal.org/node/514918#comments Module development Drupal 6.x Thu, 09 Jul 2009 17:40:40 +0000 rjb 514918 at http://drupal.org admin_menu links on localhost http://drupal.org/node/514880 <p>Hope this is the right place to post issues with the admin_menu.</p> <p>When running the menu on localhost, the path is missing my folder /drupal. Links is composed as: <a href="http://localhost/admin/" title="http://localhost/admin/" rel="nofollow">http://localhost/admin/</a></p> <p>I have copied all remote files to local and imported remote database. And it is the same issue when I call the remote database instead of the local. No problems running the menu remote.</p> <p>Is there a fix for this?</p> http://drupal.org/node/514880#comments Module development Drupal 6.x Thu, 09 Jul 2009 16:58:16 +0000 joergenaj 514880 at http://drupal.org 301 redirect http://drupal.org/node/514844 <p>Hi can somebody please help me with this.</p> <p>I want to catch traffic for a niche search term under blood pressure searched for in a certain city. For instance, as an example lets say I saw the bp newbridge was a used search term. I tried to buy it as <a href="http://www.bpnewbridge.co.uk" title="www.bpnewbridge.co.uk" rel="nofollow">www.bpnewbridge.co.uk</a> etc but was taken as was similar with a hypen. But <a href="http://www.b-p-newbridge" title="www.b-p-newbridge" rel="nofollow">www.b-p-newbridge</a> wasn't. Is it posssible to but this domain name and use 301 redirect to my actual branded site that will be about healthcare. I want to catch the traffic and build a nice brand too. Do the searchengines see b-p-newbridge as bp newbridge like I think they will.</p> <p>Thanks</p> http://drupal.org/node/514844#comments Module development Drupal 6.x Thu, 09 Jul 2009 16:20:32 +0000 Jeannie 514844 at http://drupal.org how do i redirect a registered url to my static ip/folder on my windows web server? (using wamp) http://drupal.org/node/514814 <p>how do i redirect a registered url to my static ip/folder on my windows web server? (using wamp)</p> http://drupal.org/node/514814#comments Module development Drupal 6.x Thu, 09 Jul 2009 15:54:01 +0000 fuckinsteve 514814 at http://drupal.org downloading news management system...problem!!! http://drupal.org/node/514802 <p>hi all;<br /> i want a module that handel news management like edit new news and add or delete that would propaplly appeares on the home page for public....</p> <p>if any suggestions for good modules that achieve my goal ,i would very thankful....</p> <p>thanks for advance</p> http://drupal.org/node/514802#comments Module development Drupal 6.x Thu, 09 Jul 2009 15:44:40 +0000 amira 514802 at http://drupal.org date popup http://drupal.org/node/514728 <p>after installing</p> <p> - Date<br /> - Date API<br /> - Date Popup<br /> - Date Timezone</p> <p>I m trying to add a content type "manage fields" in CCK.</p> <p>Field Value<br /> Label Time<br /> Field name time<br /> Select a field type Datetime<br /> Select a widget Text field with jQuery pop-up calendar.</p> <p>However, "Text field with jQuery pop-up calendar" is NOT in thge select list.</p> <p>Appreciate if anyone could give me suggestion.</p> http://drupal.org/node/514728#comments Module development Drupal 6.x Thu, 09 Jul 2009 14:36:02 +0000 kenjimori 514728 at http://drupal.org Custom search blocks http://drupal.org/node/514726 <p>Hello everyone!</p> <p>I have a question about custom search blocks.<br /> Here's my situation:</p> <p>I created a few content type modules, "news", "events", "clips" etc.</p> <p>I need a different search block for every content type which only displays a textfield an a submit button like the "search modules" block you see here: <a href="http://drupal.org/project/modules" title="http://drupal.org/project/modules" rel="nofollow">http://drupal.org/project/modules</a></p> <p>I wonder how that block is made, I personally expected it was possible to make a search block with some hook and place it in every content type module.</p> <p>Any ideas?</p> http://drupal.org/node/514726#comments Module development Drupal 5.x Thu, 09 Jul 2009 14:35:22 +0000 lennartweb 514726 at http://drupal.org Caching data http://drupal.org/node/514698 <p>I'm developing a module which validates a number of different custom node types. The validation is pretty complicated - not to mention boring - but as part of it my module builds an array which contains data about certain nodes. This array is then used in the validation.</p> <p>The way the module is written at the moment is very heavy on the database, so I want to introduce caching that works like this:</p> <p>(1) Node form is submitted.<br /> (2) Is the validation array set? If not, set it by querying the database. If it is set, use the existing values.<br /> (3) Carry out the validation.</p> <p>I've read <a href="http://www.lullabot.com/articles/a_beginners_guide_to_caching_data" title="http://www.lullabot.com/articles/a_beginners_guide_to_caching_data" rel="nofollow">http://www.lullabot.com/articles/a_beginners_guide_to_caching_data</a> which is really useful, but it seems to suggest that I will lose my static variable as soon as the node is submitted which kind of misses the point of what I want to do. Any tips?</p> http://drupal.org/node/514698#comments Module development Drupal 6.x Thu, 09 Jul 2009 14:14:41 +0000 jim0203 514698 at http://drupal.org Identifying commenters Operating Systems http://drupal.org/node/514670 <p>I am using the Forum Module.<br /> Is there a way to display which Operating System each user is using when they post a message or reply?</p> http://drupal.org/node/514670#comments Module development Drupal 6.x Thu, 09 Jul 2009 13:42:59 +0000 MikeonTV 514670 at http://drupal.org MySQL server has gone on short queries http://drupal.org/node/514596 <p>I don't understand what's wrong with my MySQL configuration.<br /> max_allowed_packet is not exceeded if following query have only couple of letters.</p> <p><div class="codeblock"><code>db_query(&quot;SELECT @@SESSION.max_allowed_packet&quot;)</code></div><br /> causing:<br /> <div class="codeblock"><code>: Error MySQL server has gone away<br />query: SELECT @@SESSION.max_allowed_packet</code></div></p> <p>It's a MySQL bug?</p> http://drupal.org/node/514596#comments Module development Drupal 5.x Drupal 6.x Drupal 7.x Thu, 09 Jul 2009 12:10:28 +0000 kenorb 514596 at http://drupal.org Player in flv videos: SWFTool, Flashnode http://drupal.org/node/514510 <p>Hello, I'm using SWFTools (and also Flash node as an alternative) to upload a flv video on my site. I converted an avi file with a freeware software (DVDVideo Soft) which allows to put a player in converted videos too.......... problem is when I upload it to the site, the player won't show up, and I can't understand why. Should I put the files for the player ( I mean, one style.css, one player.swf and one jpg file with the frame og the player)... somewhere into drupal root?????? I can't understand.. hope someone knows!!! thanks</p> http://drupal.org/node/514510#comments Module development Drupal 6.x Thu, 09 Jul 2009 10:37:29 +0000 giozzz 514510 at http://drupal.org When previewing add node form, some user input is not retained http://drupal.org/node/514504 <p>Hi,</p> <p>I have created a Content Type (property) and i'm using it in conjunction with the Location module and GMap module to allow the user to add a 'Property' and set its Long/Lat with GMaps. GMaps is then shown when a user views the property.</p> <p>This all works fine, apart from two little niggles i'd like to sort out.</p> <p>Firstly, I have added a new Marker to the GMap module, which works when viewing the Property - however when you are completing the Add Property form, the standard marker is used - is there anyway I can change this?</p> <p>Secondly, when completing the same form there are fields to complete for the Location module (Street, Additional, City, State/Province, Postal code). When you click Preview, the values for these fields are not remembered and the user has to complete this part of the form again. The standard CCK form element values are remembered. Can anyone suggest a way I might sort this out?</p> <p>Thanks,<br /> Dave C</p> http://drupal.org/node/514504#comments Module development Drupal 6.x Thu, 09 Jul 2009 10:22:14 +0000 davecox 514504 at http://drupal.org Content explorer ala Google's Wonder Wheel http://drupal.org/node/514474 <p>Our site (based on Drupal v5.) is content rich and subject specific. Our content is highly-interrelated and I'd like to present our visitors with a graphical tool for exploring the content along these relationship lines.</p> <p><a href="http://drupal.org/node/514474" target="_blank">read more</a></p> http://drupal.org/node/514474#comments Module development Drupal 5.x Thu, 09 Jul 2009 09:49:22 +0000 pedantix 514474 at http://drupal.org