利用內建之列印功能...文章內的圖片無法列印
請指教...謝謝
●架設主機作業系統:linux
●您的上網方式:hinet adsl
●您安裝的程式:Apache+PHP+mysql
●您的 phpBB3 版本:phpBB3.0+竹貓中文語言檔
●您的 phpBB3 使用風格:prosilver
●您的 domain(網域名稱) :nonamexpe.duc.cc
●您的 phpBB3 連結網址: http://nonamexpe.duc.cc
●測試帳號 test 密碼123456
實際上文章內有圖片
列印模式無圖片...只有圖片檔名
該如何修改才能讓列印模式也有圖片呢?[問題]利用內建之列印功能...文章內的圖片無法列印(已解決)
版主: 版主管理群
[問題]利用內建之列印功能...文章內的圖片無法列印(已解決)
最後由 jzdai0903 於 2008-04-16 22:49 編輯,總共編輯了 3 次。
●架設主機作業系統:LINUX
●您的上網方式:hinet adsl
●您安裝的程式:Apache+PHP+mysql
●您的 phpBB3 版本:phpBB3.0+竹貓中文語言檔
●您的 phpBB3 使用風格:prosilver
●您的 domain(網域名稱) :nonamexpe.duc.cc
●您的 phpBB3 連結網址: http://nonamexpe.duc.cc
●測試帳號 test 密碼123456
-------------------------------------------------------------------------------------------------------------
歡迎對XPE有興趣的網友加入 NoName Information Team 討論區
-------------------------------------------------------------------------------------------------------------
●您的上網方式:hinet adsl
●您安裝的程式:Apache+PHP+mysql
●您的 phpBB3 版本:phpBB3.0+竹貓中文語言檔
●您的 phpBB3 使用風格:prosilver
●您的 domain(網域名稱) :nonamexpe.duc.cc
●您的 phpBB3 連結網址: http://nonamexpe.duc.cc
●測試帳號 test 密碼123456
-------------------------------------------------------------------------------------------------------------
歡迎對XPE有興趣的網友加入 NoName Information Team 討論區
-------------------------------------------------------------------------------------------------------------
Re: [問題]利用內建之列印功能...文章內的圖片無法列印
請問如何讓 內的圖片也顯現出來呢?
代碼: 選擇全部
[img] ...[/img]
------------8<----------Cut it here!-----------8<-------------
phpBB 不進則退
phpBB 不進則退
Re: [問題]利用內建之列印功能...文章內的圖片無法列印
在同樣的地方加入:
老樣子 記得重新整理主題
代碼: 選擇全部
.content img {
display: block;
}
Re: [問題]利用內建之列印功能...文章內的圖片無法列印
目前已可以正常顯示出圖片...
不過該如何修改才能達到顯示出來的圖片可以有縮圖的功能呢?
例如圖片寬度最大顯示為600...類似下面放在viewtopic_body.html內的語法...
不過該如何修改才能達到顯示出來的圖片可以有縮圖的功能呢?
例如圖片寬度最大顯示為600...類似下面放在viewtopic_body.html內的語法...
代碼: 選擇全部
<script>
window.onload = resizeimg;
function resizeimg()
{
if (document.getElementsByTagName)
{
for (i=0; i<document.getElementsByTagName('img').length; i++)
{
im = document.getElementsByTagName('img')[i];
if (im.width > 600)
{
im.style.width = '600px';
eval("pop" + String(i) + " = new Function(\"pop = window.open('" + im.src + " ','fullscale','width=400,height=400,scrollbars=1,resizable=1'); pop.focus();\")");
eval("im.onclick = pop" + String(i) + ";");
if (document.all) im.style.cursor = 'hand';
if (!document.all) im.style.cursor = 'pointer';
im.title = '按此, 觀看完整大小的圖片';
}
}
}
}
</script>
●架設主機作業系統:LINUX
●您的上網方式:hinet adsl
●您安裝的程式:Apache+PHP+mysql
●您的 phpBB3 版本:phpBB3.0+竹貓中文語言檔
●您的 phpBB3 使用風格:prosilver
●您的 domain(網域名稱) :nonamexpe.duc.cc
●您的 phpBB3 連結網址: http://nonamexpe.duc.cc
●測試帳號 test 密碼123456
-------------------------------------------------------------------------------------------------------------
歡迎對XPE有興趣的網友加入 NoName Information Team 討論區
-------------------------------------------------------------------------------------------------------------
●您的上網方式:hinet adsl
●您安裝的程式:Apache+PHP+mysql
●您的 phpBB3 版本:phpBB3.0+竹貓中文語言檔
●您的 phpBB3 使用風格:prosilver
●您的 domain(網域名稱) :nonamexpe.duc.cc
●您的 phpBB3 連結網址: http://nonamexpe.duc.cc
●測試帳號 test 密碼123456
-------------------------------------------------------------------------------------------------------------
歡迎對XPE有興趣的網友加入 NoName Information Team 討論區
-------------------------------------------------------------------------------------------------------------
Re: [問題]利用內建之列印功能...文章內的圖片無法列印
幫你改好了,請服用:
改完請記得重新整理樣板._./
代碼: 選擇全部
<script type="text/javascript">
// <![CDATA[
onload_functions.push('resizeimg()');
function resizeimg()
{
var width_constraint = 600;
if (document.getElementsByTagName)
{
for (i=0; i<document.getElementsByTagName('img').length; i++)
{
im = document.getElementsByTagName('img')[i];
if (im.width > width_constraint)
{
im.style.height = ((width_constraint * im.height) / im.width) + "px";
im.style.width = width_constraint + "px";
eval("pop" + String(i) + " = new Function(\"pop = window.open('" + im.src + " ','fullscale','width=" + width_constraint + ",height=400,scrollbars=1,resizable=1'); pop.focus();\")");
eval("im.onclick = pop" + String(i) + ";");
if (document.all) im.style.cursor = 'hand';
if (!document.all) im.style.cursor = 'pointer';
im.title = '按此, 觀看完整大小的圖片';
}
}
}
}
// ]]>
</script>
Re: [問題]利用內建之列印功能...文章內的圖片無法列印
這個是只會縮文章圖片和附件圖片的版本,如果論壇上有文章以外的大圖(如Logo)就不會一起被表到。
代碼: 選擇全部
<script type="text/javascript">
// <![CDATA[
onload_functions.push('resizeimg()');
function resizeimg()
{
var width_constraint = 600;
if (document.getElementsByTagName)
{
for (i=0; i<document.getElementsByTagName('img').length; i++)
{
im = document.getElementsByTagName('img')[i];
if (im.parentElement.className != 'content' &&
im.parentElement.className != 'attach-image')
continue;
if (im.width > width_constraint)
{
im.style.height = ((width_constraint * im.height) / im.width) + "px";
im.style.width = width_constraint + "px";
eval("pop" + String(i) + " = new Function(\"pop = window.open('" + im.src + " ','fullscale','width=" + width_constraint + ",height=400,scrollbars=1,resizable=1'); pop.focus();\")");
eval("im.onclick = pop" + String(i) + ";");
if (document.all) im.style.cursor = 'hand';
if (!document.all) im.style.cursor = 'pointer';
im.title = '按此, 觀看完整大小的圖片';
}
}
}
}
// ]]>
</script>
Re: [問題]利用內建之列印功能...文章內的圖片無法列印
TO wasabi
我上面有說錯...
功能應該是...
預覽列印頁面中的圖片...
寬度超過600以上的圖片...就會縮成400 * 400
附件中的圖...文章內的圖...外部連結的圖都可以縮圖...
感謝你的回覆...不過這些語法要放在哪個檔案的哪邊QQ
另外這個主題的問題有解嗎?謝謝
http://phpbb-tw.net/phpbb/viewtopic.php?f=116&t=50477
我上面有說錯...
功能應該是...
預覽列印頁面中的圖片...
寬度超過600以上的圖片...就會縮成400 * 400
附件中的圖...文章內的圖...外部連結的圖都可以縮圖...
感謝你的回覆...不過這些語法要放在哪個檔案的哪邊QQ
另外這個主題的問題有解嗎?謝謝
http://phpbb-tw.net/phpbb/viewtopic.php?f=116&t=50477
●架設主機作業系統:LINUX
●您的上網方式:hinet adsl
●您安裝的程式:Apache+PHP+mysql
●您的 phpBB3 版本:phpBB3.0+竹貓中文語言檔
●您的 phpBB3 使用風格:prosilver
●您的 domain(網域名稱) :nonamexpe.duc.cc
●您的 phpBB3 連結網址: http://nonamexpe.duc.cc
●測試帳號 test 密碼123456
-------------------------------------------------------------------------------------------------------------
歡迎對XPE有興趣的網友加入 NoName Information Team 討論區
-------------------------------------------------------------------------------------------------------------
●您的上網方式:hinet adsl
●您安裝的程式:Apache+PHP+mysql
●您的 phpBB3 版本:phpBB3.0+竹貓中文語言檔
●您的 phpBB3 使用風格:prosilver
●您的 domain(網域名稱) :nonamexpe.duc.cc
●您的 phpBB3 連結網址: http://nonamexpe.duc.cc
●測試帳號 test 密碼123456
-------------------------------------------------------------------------------------------------------------
歡迎對XPE有興趣的網友加入 NoName Information Team 討論區
-------------------------------------------------------------------------------------------------------------
Re: [問題]利用內建之列印功能...文章內的圖片無法列印
口厄... 你確定你要的是固定把圖縮成400 * 400而不是按比例縮放,例如800 * 600縮成400 * 300?
這個版本是把寬度多於400的固定縮成400 * 400:
這個則是按比例縮放:
把這段code放在styles/你的風格/template/viewtopic_print.html裡面
這一段底下就可以了。
這個版本是把寬度多於400的固定縮成400 * 400:
代碼: 選擇全部
<script type="text/javascript">
// <![CDATA[
window.onload = function()
{
var width_constraint = 400;
if (document.getElementsByTagName)
{
for (i=0; i<document.getElementsByTagName('img').length; i++)
{
im = document.getElementsByTagName('img')[i];
if (im.parentElement.className != 'content' &&
im.parentElement.className != 'attach-image')
continue;
if (im.width > width_constraint)
{
//im.style.height = ((width_constraint * im.height) / im.width) + "px";
im.style.height = width_constraint + "px";
im.style.width = width_constraint + "px";
eval("pop" + String(i) + " = new Function(\"pop = window.open('" + im.src + " ','fullscale','width=" + width_constraint + ",height=400,scrollbars=1,resizable=1'); pop.focus();\")");
eval("im.onclick = pop" + String(i) + ";");
if (document.all) im.style.cursor = 'hand';
if (!document.all) im.style.cursor = 'pointer';
im.title = '按此, 觀看完整大小的圖片';
}
}
}
}
// ]]>
</script>
代碼: 選擇全部
<script type="text/javascript">
// <![CDATA[
window.onload = function()
{
var width_constraint = 400;
if (document.getElementsByTagName)
{
for (i=0; i<document.getElementsByTagName('img').length; i++)
{
im = document.getElementsByTagName('img')[i];
if (im.parentElement.className != 'content' &&
im.parentElement.className != 'attach-image')
continue;
if (im.width > width_constraint)
{
im.style.height = ((width_constraint * im.height) / im.width) + "px";
im.style.width = width_constraint + "px";
eval("pop" + String(i) + " = new Function(\"pop = window.open('" + im.src + " ','fullscale','width=" + width_constraint + ",height=400,scrollbars=1,resizable=1'); pop.focus();\")");
eval("im.onclick = pop" + String(i) + ";");
if (document.all) im.style.cursor = 'hand';
if (!document.all) im.style.cursor = 'pointer';
im.title = '按此, 觀看完整大小的圖片';
}
}
}
}
// ]]>
</script>
代碼: 選擇全部
<title>{SITENAME} • {PAGE_TITLE}</title>