Mysql: update weight by an auto-incremented string created on the fly

Submitted by Anonymous (not verified) on Fri, 09/23/2011 - 11:52

I had a problem with Drupal6 by sorting tags. Mysql can sort or place some non-ascii letters correctly but PHP can not.

Example: I have a list of cities and I want to sort them by first letter. I want that "ívori" and "îwata" beeing listet with "Ibiza" under "i". PHP places both ívori and îwata after Z. To prevent this I update "weight" manually with mysql and sort them by weight instead of alpha.

select @my_temp_counter:=0;
update `term_data` set weight = (@my_temp_counter:=@my_temp_counter+1) order by name;

List of Domains with Google PageRank 10

Submitted by Anonymous (not verified) on Fri, 09/09/2011 - 11:04

Google updated Pagerank database in august 2011. Here is a list of top 10 Domains with Google PageRank 10. (social media) (us-american news company) (social bookmarking script) (Chinese Goverment) (a service of Google) (US Goverment) (US-Department of Health and Human services) (PHP-Mysql based real time web analytics software, open source alternative to Google Analytics)

CSS hierarchy and inline style sheets

Submitted by Anonymous (not verified) on Thu, 07/07/2011 - 11:33

I have a problem with inline stylesheets. I like to use inline style sheets instead of using css code in head section of an html page or an external .css file.


But I have a problem when I want it to ffect just a part of subelement and not other paralell elements.

Example 2:

    • ...

I want to my third-level "ul" have border but second-level not. I can do it with css code like this:

div ul { border: none; }
div ul li ul { border: 1px solid red; }

Print Screenshot of one monitor while using dual-monitore system

Submitted by Anonymous (not verified) on Wed, 04/27/2011 - 09:55

I am using an i7 box with dual monitore: HP Compaq and Samsung. I want to get screenshot of the right monitore which is vertically placed. If I press on "print" key I get a wide screenshot of both monitors.

My first monitore is placed horizontally and has a width of: 1920x1200px

Second one: 1200x1920px

When I press on PRINT I get an image :


To get active monitor: ALT + PRINT

Failed to modify server : AWstats reporting is already enabled for this domain

Submitted by Anonymous (not verified) on Wed, 04/20/2011 - 19:22

I have a problem: I have a website which is older than 10 years. I was using a cpanel-whm server till 4 years ago. Than I changed to a Debian Lamp server with webmin. And upgraded the server last month. I had migrated cpanel-backups to webmin and after upgrade migrated webmin-backups to new webmin on new server. Awstats is not checked and not to see under logs tab. But when I try to check and activate Awstats under "edit virtual server" tab, I get this error: Failed to modify server : AWstats reporting is already enabled for this domain.

How can I pass this error? Thanks

Sort Drupal taxonomy terms by custom weight

Submitted by Anonymous (not verified) on Mon, 04/11/2011 - 16:24

I have got a problem with Drupals taxonomy sorting alghoritm. I got a taxonomy group for authors. I created a block with tagedelic "tags in authors". The problem there was that tagedelic couldnt put in right place author-names starting with letters like é, í, ò etc.

To solve it. I exported all terms and edited them in Notepad++. I sort terms by alpha, gave them an automated line number. And combined line number with Drupals weight range (scala +49 to -49).

update term_data set weight = -49+\1/3 where tid=\2 /* \3 */ ;

\1 is line number.