User:Gmaxwell/non-free in templates

From Wikipedia, the free encyclopedia

mysql> select concat('*[[:Image:',ip.page_title,']] - [[Template:', tp.page_title,']]') from page as tp join imagelinks on il_from=tp.page_id join page as ip on (ip.page_namespace=6 and ip.page_title=il_to) where tp.page_namespace=10 and exists (select 1 from templatelinks where tl_from=ip.page_id and tl_namespace=10 and tl_title like 'Non-free%' limit 1) and not exists (select 1 from templatelinks where tl_from=ip.page_id and tl_namespace=10 and tl_title='CopyrightByWikimedia' limit 1) order by ip.page_title,tp.page_title;