a blog about handmade code

php

PHP is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow web developers to write dynamically generated pages quickly.

Getting categories for a post

For more control over the post's category, use wp_get_post_categories function. It is a simple solution than doing a custom query. It requies passing a post id and arguments. To understand the arguments read about it from wp_get_object_terms. For information see wp_get_object_terms at http://codex.wordpress.org/Function_Reference/wp_get_object_terms

phpfox accessing user group settings and variables

Accessing the User Group Settings (variables)

Lets say you want access to the user group setting for the blogs and find if they can add a new blog. In your controller class add:

Drupal WYSIWYG == Wordpress WYSIWYG

Ever wanted your drupal wysiwyg content formated like wordpress? WYSIWYG Force Linebreaks module is just the thing.

Here's a list of things it will do to the source code:

  • Get a nice and clean formated text
  • Preserve tabs, returns, etc
  • Turn <br /> and <p> into line breaks (carriage return) very similiar to wordpress

Get your copy and install: http://drupal.org/project/wysiwyg_linebreaks

Once that is done, do the following.

Drupal upgrade 7.2 login denied and panels error

I upgrading to drupal 7.2 last night. This morning i had issues logging in and tried to retrieve my one time login. Than I got an access denied page, see http://drupal.org/node/1170132. After a few more attempts to login i recieved a fatal error with panels. see http://drupal.org/node/1139732. The mini panel couldn't call the choas tool export class.

I've only found a temporary solution.

Event Manager Extended Template and Theme Through PHP

I have installed Events Manager Extended and had issues with having the content layout exactly the same as ics file.  After a little research, I found a way to seperate the two contents.

Here's what I've been able to do:

  • Reformat the single events theme and layout using php
  • Display the events variable from the Events Manager
  • The Default single event format  in the admin will be the content format for the ics file

In your theme folder, open up page.php. Insert the following code.

Subscribe to RSS - php
©2012 Tranzic Media / Portfolio of Vasna Sdoeung