entroducing.com
  • Home
  • Coding
  • Trading
  • Troubleshooting
    • Operating System
    • Networking
  • Reviews
  • Travel
  • Quick Snap
  • Thoughts
  • Side Hustle
  • Earn Passive Income/Referral
Website sponsored by LingeriesG
@2023 - All Right Reserved. Entroducing. Sponsored by mm3288
Codingphpsymfony

symfony backend: displaying thumbnail or photo in listing

by Ben January 9, 2011
written by Ben

if you are using the admin generator to generate your backend application and want to show thumbnail or photo in your listing, you can try the following steps.

Here’s an example of how it will looks like when the thumbnail is showing on the listing page.

Before you add it in, you need to check the variable name of the row that the admin generator uses.

To check the variable name, go to the cache folder for the module and open the _list.php file with a notepad.
Take note of the row

\\cache\backend\dev\modules\autoContestphoto\templates\_list.php
...
        <?php foreach ($pager->getResults() as $i => $contest_photo): $odd = fmod(++$i, 2) ? 'odd' : 'even' ?>
          <tr class="sf_admin_row <?php echo $odd ?>">
            <?php include_partial('contestphoto/list_td_batch_actions', array('contest_photo' => $contest_photo, 'helper' => $helper)) ?>
            <?php include_partial('contestphoto/list_td_tabular', array('contest_photo' => $contest_photo)) ?>
            <?php include_partial('contestphoto/list_td_actions', array('contest_photo' => $contest_photo, 'helper' => $helper)) ?>
          </tr>
        <?php endforeach; ?>
...

In my case, the variable name for the row is $contest_photo

Next, create a partial call _thumbnail.php in the template folder of the module.
In this partial, echo the path of the thumbnail or the photo with a img html tag

\\apps\backend\modules\contestphoto\templates\_thumbnail.php
<img src="<?php echo $contest_photo->getThumbnailPath() ?>"/>

Then, edit the generator file to include the _thumbnail column for your list

\\apps\backend\modules\contest\config\generator.yml


...

      list:
        title: Contest Photo Management
        display: [=title, contest, category, user, title, isDeleted, _thumbnail]
        sort: [created_at, desc]
        max_per_page: 50

...

Clear your cache and see if the thumbnail loads.

January 9, 2011 1 comment
0 FacebookTwitterPinterestEmail
Codingphpsymfony

Symfony error : Call to undefined method myUser::setReferer.

by Ben December 27, 2010
written by Ben

If you have this error

Call to undefined method myUser::setReferer.

and if you are using sfGuard plugin, go to

apps\[project]\lib\myUser.class.php

and change


class myUser extends sfBasicSecurityUser
{
}

to


class myUser extends sfGuardSecurityUser
{
}

December 27, 2010 1 comment
0 FacebookTwitterPinterestEmail
Codingphpsymfony

You are not allowed to access this file. Check frontend_dev.php for more information.

by Ben October 23, 2010
written by Ben

If you had deployed to production/LIVE environment and encounter this error message when you tried to access fontend_dev.php, it is due to a security IP check in fontend_dev.php to check for 127.0.0.1 before it continue.

Thus, you need to add your public IP address in fontend_dev.php to tell symfony to let you through in the production environment. Here’s how to do it

In your fontend_dev.php file, put in the below line to print out your public ip address

echo $_SERVER['REMOTE_ADDR']. "<br/>"

Access frontend_dev.php and copy the IP address as shown.

Edit frontend_dev.php and change the line

if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1')))

to

if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1', '111.222.333.444')))

Where 111.222.333.444 is the IP address you copied.

Upload back the frontend_dev.php and try again

October 23, 2010 0 comments
0 FacebookTwitterPinterestEmail
Operating System

Non-Unicode program displaying Chinese characters as box/square in Windows 7

by Ben October 10, 2010
written by Ben

If you have a chinese/non-unicode program that is displaying funny/box/square/garbage characters in Windows 7, you may want to try this method to display it properly.

Continue Reading
October 10, 2010 1 comment
0 FacebookTwitterPinterestEmail
phpsymfony

building new app with symfony : week 1

by Ben September 30, 2010
written by Ben

Going to build a new photography website which will be maintain by my friend and myself.

Am looking at the current popular PHP frameworks which need to fufil the following requirement

  1. rapid development
  2. easy maintainance
  3. user account management
  4. file upload
  5. able to integrate easily with image manipulation library (GD lib)
  6. Suitable for a shared-hosting environment

Currently shortlisted

  1. CakePHP (which I have some experience with version 1.2)
  2. Symfony

Had do some googling and below are the pros and cons for each frameworks

CakePHP

Pro

  1. easy to code
  2. built in security access
  3. access of data via arrays

Cons

  1. Quite new as compare to Symony
  2. No (or little?) test functionality?

Symfony

Pros

  1. able to build an enterprise app (otherwise why would yahoo use it?)
  2. access of data via propel or doctrine (i.e. object oriented) as they are well supported
  3. Able to reload data easily
  4. Able to create test cases

Cons

  1. steep learning curve
  2. Complicated?

I decided to give myself a week to learn Syfmony before I decide which framework to use.

September 30, 2010 0 comments
0 FacebookTwitterPinterestEmail
Operating System

Blue screen in Windows 7 when turning on AHCI in BIOS

by Ben September 18, 2010
written by Ben

If you have blue screen when starting Windows 7 after you enable AHCI, try follow the below step to disable AHCI and force windows to reload/reinstall AHCI drivers on next boot.

  1. Disable AHCI in BIOS; turn HDD configuration to IDE
  2. Click Start, type regedit in the Search box, and then press ENTER.
  3. Locate the following registry key
  4. HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Msahci
  5. In the right pane, right-click Start in the Name column, and then click Modify.
  6. In the Value data box, type 0, and then click OK.
  7. Reboot your computer and boot into BIOS setup
  8. Turn on AHCI in your HDD configuration

September 18, 2010 3 comments
0 FacebookTwitterPinterestEmail
Networking

extend wireless network: Part 2 – extend with linksys (DD-WRT)

by Ben August 15, 2010
written by Ben

In this 2nd part of “extend dlink 655 wireless network with linksys (DD-WRT) and engenius routers“, I will show you how to set your linksys router (DD-WRT firmware) to connect to d-link 655 router in WDS mode.

To recap, my linksys router is a repeater of my main internet router d-link655 and it is connected to a printer.

Continue Reading
August 15, 2010 2 comments
0 FacebookTwitterPinterestEmail
Operating System

How to solve yellowish tint or layer in Windows 7 Photo Viewer

by Ben August 15, 2010
written by Ben

One fine day, when I were viewing my photos in windows 7, I got shocked when I saw a yellowish tint or an overlayer that appeared on not only for one photo but all my photos!

I googled around and found out that this is a bug or issue caused by buggy/conflicting monitor profile with Windows 7.

And here’s the step-by-step procedures to solve it.

Continue Reading
August 15, 2010 2 comments
0 FacebookTwitterPinterestEmail
  • 1
  • …
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

Search

Categories

  • Coding
    • apache
    • cakephp
    • java
    • magento
    • php
    • SQL
    • symfony
    • wordpress
  • Hosting
  • Quick Snap
  • Reviews
  • Side Hustle
  • Thoughts
  • Trading
  • Travel
  • Troubleshooting
    • Networking
    • Operating System

Tags

3.28 angry bird jb angry birds activity park apache beijing cakephp cdata cruise crypto docker elasticsearch element mall fil ftx claim hacked hanshou how-to html data in xml java johor bahru jumper land linux mac magento magento2 malacca malaysia travel move-to-earn passive income php plugin Programming rides side hustle stepn stfil stfil.io struts SyntaxHighlighter theme travel VPS windows 7 wordpress xampp
  • Email

@2023 - All Right Reserved. Entroducing. Sponsored by mm3288