|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
( ~ j# x2 m) y8 c) k// Theme Option
" D% r* N$ w2 P3 _7 t////////////////////////////////////////////////////////////////////////////////
" X1 q& T P# h) Q( E! R
! T0 p! i- P# y' [& G$themename = "Zenx";
{( d+ q% t: I% J# \* d! V$shortname = str_replace(' ', '_', strtolower($themename));
?# `/ H q# o; ~4 i; \7 j
& f0 i; i$ g8 a9 |function get_theme_option($option)
* B6 c9 g8 @" z$ J' W% {{
# x# z6 _1 r9 ]% |( d global $shortname;5 z$ B( ]2 [3 V4 T: L, w
return stripslashes(get_option($shortname . '_' . $option));" _3 r7 S& n' j( X4 t
}# r- T. X$ B7 v& V% B* p" e
. f) |3 Q" }- V* [. i+ {function get_theme_settings($option)
2 Y# h( c9 v5 q" R3 X* ~, N{
: Z+ q' Q1 z- D8 O return stripslashes(get_option($option));
6 C& g2 l, Y7 t$ X0 B}4 P2 v/ k: R2 ?+ x4 u3 u
$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");
& |1 E' M6 v; P# E$wp_getcat = array();. ` W6 s) R0 U9 b; \0 E
foreach ($wp_dropdown_rd_admin as $category_list) {
( \% N: e+ O0 y1 w2 Z, D5 M$wp_getcat[$category_list->term_id] = $category_list->name;2 z$ i: V6 c, z6 b
}7 T% u3 w2 D* g
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
* D2 I$ u; t5 r1 c5 ?$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
) S0 p$ \# A4 |' E9 ~8 _$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");- Y( y' {6 q8 t
9 c8 h/ J7 F% d5 {: w$ I8 f5 G! R; j$options = array (: y! U, G8 v& C% X
6 y, N' J9 @4 b: w5 G; l& P7 v' X! Y6 a$ s' w
array( "name" => "Blog Header Settings",# P. F3 h% Q: A0 v7 c- w
"type" => "heading",
. t; m% H" [- I: W" g" G ),! o6 F% F; d4 c
. J; _) o: ~6 j* q9 v
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",0 V/ W. `# L4 z0 \8 y" }
"id" => $shortname."_header_logo_activate",
# l4 t3 b8 _2 G; g "type" => "select",0 B1 Z _+ Q! \; g1 u; _
"std" => "No",7 t. g9 F c1 t1 r& H+ m9 y& c
"options" => array("No", "Yes")),
. d: |5 G$ A; D6 g8 ?/ l
' \$ r3 s5 m$ N! q0 ? array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
# ?3 }- R" j: a" S9 D+ C% W D5 V "id" => $shortname."_logo_url",
) O" L( [, n6 | a$ ~ "type" => "text",
9 V ?; l3 h) B "box" => "social",
2 F7 `& q1 V$ r# }, d2 R# K "std" => "",
7 ?/ G8 S5 v- R m+ h ),5 Q2 A5 N& l) U8 ]
( p0 z: h! c+ ~/ w
array( "name" => "Insert Header Banner HTML Code (Header)
8 Y; O- v( x& O6 i8 m4 T* K& b <br /><em>*Recommended Size 468 x 60</em>
4 r7 X$ H& z3 S9 X# i/ D <br /><em>*leave blank if not use</em>",& Y) Q& y5 }: z; O4 v
"id" => $shortname."_header_banner",+ n& I& V+ {; c6 {% V6 g
"type" => "textarea",3 w7 R, W) B) C. |' i8 @
"std" => "",
+ M* I( ?$ w+ d* j ),
8 {% j+ w- x% G- R2 s6 n
9 y! n, y3 M0 W4 T array( "name" => "</div></div>",# c9 k+ t6 W$ v6 B: `
"type" => "close",
( |. V2 A6 M; Q, ? z0 q ),
5 X+ E. W {# r* Q F$ {# Q' v: B: D! S1 J0 D0 ^& F& a
3 F/ Z# [0 M5 |3 x( g+ K
array( "name" => "Header Navigation Settings",
, _4 k# O# \% L "type" => "heading",
- k |# t( K( `4 \- |" P' w L$ N1 \ ),) b" I0 R6 W$ T+ V
" B0 T% o) j' Y& f
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />' g. f9 Q# W3 M: ^0 @
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />/ _" e M# p. b4 M q- a
<em>*Enter the page post ID number only</em><br />$ O" s5 ~( j% c! q E5 l
<em>*separate by comma</em><br />) ~ I) P. @( n3 L! X0 Y! i
<em>*Exclude pages which you don't want to show on the header navigation</em>",
% _) w4 I! r8 B8 s& G/ d8 n9 g; \# I "id" => $shortname."_header_page_navigation",
2 ]$ j( ]9 {% `# F u* e "type" => "text",, ?2 r- m7 |' \$ J' e
"std" => "",
" l. S9 w1 m+ I5 \4 o ),4 g1 Q n8 `5 }3 @- m# ~
2 ? g/ K7 Y4 y+ X9 c: X
array( "name" => "</div></div>",
' f, h: O* s5 M5 f "type" => "close",; g2 @2 {6 [) \, T7 ]1 {
),
% i' h5 o7 A5 o) w3 e6 R9 w
_ ^, D( q; e& @& D6 J1 H$ L4 {; [4 O4 t
array( "name" => "Post Auto Thumbnails Settings",
. l& h2 A8 N# a- g- X: [ "type" => "heading",) R' K6 i4 A4 b
),6 q6 M7 `! w6 U, T2 J
: `; r. I% a+ i4 W) ]
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",8 Y9 [6 h) }3 P0 l% R
"id" => $shortname."_timthumb_activate",
. g3 H& l O# r2 Z4 E. U$ [ "type" => "select",1 _1 g7 P" g% ^% X; h! s
"std" => "No",
8 y6 r, G9 X$ T& X7 P "options" => array("No", "Yes")),
8 d4 G/ q- a6 s1 f2 F& t% w4 H2 l
6 i% L' q# a: i% j1 q2 D6 R$ D array( "name" => "If Timthumb is enabled, Please choose its cropping method",
/ |1 G7 s1 e3 s "id" => $shortname."_timthumb_cropping",; j" d5 a' K% n5 W y8 y3 v% ?, \" U: Q
"type" => "select",6 |4 d, I* H5 w2 Q5 b" e( X4 ]
"std" => "",) B. S- w: @! B& p
"options" => $crop_position),
- L4 ]. y6 a! z. v3 C
+ ]- |1 s, L# t( j" q) C array( "name" => "Insert Width Of Thumbnail Image<br />* D. L) Q2 q- M9 G. ~7 M
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />: E6 ]' S9 w$ ~# A5 Q$ ]' Q
<em>*Leave Blank To Use Default: 250</em><br />",
' ?, K: c& B9 t$ Z$ o4 s0 {) D "id" => $shortname."_thumb_width",1 ^( \' j) F: n& Q0 [2 O
"type" => "text",
' k; X' Q: i! k8 B& e "std" => "",
/ q5 M7 ]) n9 X" n- P# K! M6 b ),
/ e! O1 |9 U: y
: {: g: Y- r9 k, d+ m0 z; s array( "name" => "Insert Height Of Thumbnail Image<br />
/ X- w/ E7 H: M) {' c- G6 H <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />( C9 q L* ~' T7 n% T' t2 {
<em>*Leave Blank To Use Default: 200</em><br />",$ E# Q% ?' R. B& q
"id" => $shortname."_thumb_height",
3 n% I# O& w& ~$ I9 A1 n "type" => "text",
, `5 }1 v! V0 D7 x/ Y" m6 \' ^2 x "std" => "",
) ^4 M( @8 g$ P# R6 y+ ^' H; ~ ),8 ?4 M+ @0 J2 n5 S
; v4 d5 c* F4 v- I! H array( "name" => "</div></div>",
, z+ T# R9 T! P! J2 t# M, J "type" => "close",
& q' J) ]* h" b/ o& [" k ),
2 A8 C8 d# y( A C# y5 R3 W) J, @* K0 E! d
array( "name" => "Featured Content Slider Settings",
) n& `5 [! Q( ]/ b "type" => "heading",. q. }& [2 p2 q
),
6 z& g2 c' V. T2 K! j% b2 _# U* ]% f1 T3 f- [' U6 {% o
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
6 W7 s# R+ Z! X: h "id" => $shortname."_featured_activate",9 p* g5 Y% i4 }+ l; u6 ]
"type" => "select",
& r) k R+ Z4 g: K "std" => "No",
& L+ ~7 f# c6 b* N "options" => array("No", "Yes")),1 b3 Y& `/ y1 V( g8 X H
6 A( u" g( C4 Z& h T& X) M6 Q
& {' q1 ^2 `$ G+ h, ~ array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
& U9 G& q. j b* r: g- I "id" => $shortname."_featured_category",: L) d$ z$ s6 s! i9 j+ q+ a% U* l* ]
"type" => "select",
( \+ d& g! E: |( L2 I2 w( F3 H& a7 ] "std" => "Choose a category:",- n2 h* b1 K6 z
"options" => $wp_getcat),
5 a: S& h- _& n7 d5 G+ g1 w) d D" ], {5 X' i0 c. y
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",. ~1 R3 x2 ]9 p/ t' F
"id" => $shortname."_featured_number",
# @+ j7 m5 r$ G "type" => "select",+ j/ Q/ q; N- s7 Y4 K$ t
"std" => "Number of post:",% R. t# e3 ?% Q7 ^# J
"options" => $number_entries),
5 U& z; |# h; X6 J
6 v8 M1 p" b i, s6 ? array( "name" => "</div></div>",, w$ t0 ]9 w) o8 b# p$ t# x9 C
"type" => "close",, j: B: w" m: x5 B: x3 y% q& P
),
. W1 v# I5 Q3 h' w- {+ b 9 k2 P2 V1 h3 H5 z0 [
array( "name" => "Featured Category Settings",+ f; C1 V9 S7 u \9 S+ y" {
"type" => "heading",
* ^" t @: ^. c2 m# y: K a$ e+ s ),
1 Y' Y3 b; Z, {4 z6 K3 O. y, Z I3 j, E" f8 m V
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
3 c, v& S; s) N8 H, k4 d: C "id" => $shortname."_featured_category_activate",
# @8 P0 l% E: U! ?6 ] "type" => "select",
# k* R# p O- ? "std" => "No",% e' F% m9 ^, ]0 v) h* [
"options" => array("No", "Yes")),
: e% o9 D3 D5 O5 m( { . g b# ]7 P$ ^# {
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
! [9 b/ t% L" u/ V "id" => $shortname."_featured_category_id1"," Q! D' s* ]+ W) m" p
"type" => "select",
1 Q9 e/ r8 @- b, L1 } "std" => "Choose a category:",
. U- Z2 h! B3 U "options" => $wp_getcat), \4 c& Z1 v4 n6 D/ w" H
; x5 U, B3 _( G9 F
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
% S5 k% g7 [' f6 Q, |8 l; `7 w "id" => $shortname."_featured_number1",# b1 v9 Y7 B+ L: k" d* m
"type" => "select",8 ]5 d: z! r1 c1 k4 n0 ?
"std" => "Number of post:",/ J# d7 {7 W |7 r7 X
"options" => $number_entries),* Q; \1 k1 p! }2 }& `% V7 w; W+ w( }4 @
( l3 b4 G! W8 J+ k* [/ Y( y
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",# F2 ? }6 z# ?1 Z r1 I B' z, X7 y
"id" => $shortname."_featured_category_id2",1 C4 T& g7 m) Y! b( a8 x& Q% M
"type" => "select",) }5 A; U0 d- p
"std" => "Choose a category:",
7 J# N5 R# G9 b Q1 z "options" => $wp_getcat), }5 s9 y2 y' q- p. W+ ~
) K. X; i' `- Y7 i# p
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
" a( x2 I m9 K/ K& q "id" => $shortname."_featured_number2",
2 \' p! k$ d8 d) C5 r "type" => "select",+ @) Q7 n7 e- ~
"std" => "Number of post:",7 ?4 c/ n* Q5 L, }. v$ }# H
"options" => $number_entries),
3 y0 a" u3 b( \ - I8 f, a) T1 Y9 N* s1 [; }4 f
Y+ a( |7 {. m8 }, H3 y* b# I array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>"," z' l" R2 E3 {3 i: C5 z& a7 \, F
"id" => $shortname."_featured_category_id3",
* k# u: \% I; g) d "type" => "select",
' A; q1 p+ F0 M8 D "std" => "Choose a category:",) T1 c+ V2 ?7 U/ U, V5 T% B
"options" => $wp_getcat),$ b V* Z6 u# i) m3 M7 ]' Q
- B! V( K, ]7 Y( y/ r: m
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",7 L" m( w8 ~) D& \! d$ e
"id" => $shortname."_featured_number3",
: T, a# \" s# y& T B "type" => "select",; y% t( |- `+ x- k
"std" => "Number of post:",
; f; ]' H3 v* [+ }, ?/ {2 \ "options" => $number_entries),
2 H8 c$ N* \! s J1 d
# O' N: P f% L0 E# ]9 d$ }# ~
* g& }- U, z, s8 i array( "name" => "</div></div>",
; ~, {8 V- Y! l/ Z0 T% X "type" => "close",
7 }' i4 |( O+ T ),
& O( P- D& M1 e3 d& a+ z
) g9 A+ T# u4 @* U6 Q+ _
& i, P! n3 a9 j/ ^ P. q array( "name" => "Google Adsense & Analytics Settings",/ ]9 O: T) c4 Q4 G& m
"type" => "heading",
+ u6 v8 f: h( D6 a& G ),
% o; b) v3 a% I3 Q O
5 ?8 M6 ]9 }! A: T, A6 F: j array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",/ _2 s z0 a% S6 r$ C9 U! D8 N
"id" => $shortname."_adsense_loop_activate",2 s! M" V, ?! Q$ m
"type" => "select",
( U8 V7 |' ^3 z [ "std" => "Disable",) I: D d& p1 q8 [" ~# {$ K
"options" => array("Disable", "Enable")),: P; l. u0 R& L5 d4 l
4 j7 T; q$ m8 U+ f0 I- E array( "name" => "Insert Google Adsense Code For Loops Here<br />1 d) n" N) l9 i0 K- d8 G1 V
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",, K7 M$ X% L& T8 E/ D
"id" => $shortname."_adsense_loop",
3 S3 F( a/ j8 k; r% t7 X6 Q( |# y7 q "type" => "textarea",
& C# D! W6 P# }9 P4 I "std" => "",
4 u. r/ |) d* k# ? ),
/ ] ^+ g. W- p6 L2 I$ y1 R, u. Y( P& R+ Q% z& Q
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",' O# {! e% }2 c; E# U
"id" => $shortname."_adsense_single_activate",
3 _. \* ^2 M# t- C "type" => "select",& H4 E' I0 v2 ^/ [3 q. v
"std" => "Disable",+ Q, f' j# _9 k* o' h1 U5 [
"options" => array("Disable", "Enable")), H* }) S3 R! H2 v- r) O# X% Q
1 g" P7 y) _* M4 o" S. _ array( "name" => "Insert Google Adsense Code For Single Page Here<br />
% Z) C: |! X' u7 { <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
: b- Y& P" j0 _9 } "id" => $shortname."_adsense_single",
2 k2 {$ ?6 ^' T$ B. q B+ @+ N "type" => "textarea",
# {0 c6 S" N; i' ? "std" => "",2 a4 I& G+ u |3 L$ L
),+ R! G! }) I9 H% d
5 z5 b9 u- Y2 n. p! A% l3 F, U K
2 h2 D6 V; I. P! O5 g7 ^6 q array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
4 D; G9 x2 `" A& g$ c "id" => $shortname."_google_analytics",4 d) Z4 _% P9 g; `( \ M6 [
"type" => "textarea",
: u) f2 U/ n e' l4 L" g5 ]2 k "std" => "",: J$ ~3 Z0 D1 R0 k3 Y; z
),
- N: \/ n; Z7 v7 C/ s& a; T9 p5 O6 z/ o- {/ r4 m0 A
array( "name" => "</div></div>",: a# r/ r, m) S; A2 a( M+ x
"type" => "close", N) U' M+ J/ ?) `$ {
),# f4 o3 Q6 \+ M0 V) W$ ~2 \0 L2 O
3 Z/ E5 ^7 X. j7 i4 o; \
2 k, Y" v5 q* U. u- C- H array( "name" => "AddThis Social Bookmarking Settings",! k) \" U1 _5 l) z+ A
"type" => "heading",3 U5 C d4 P0 \# h& `! O% k. b
),
9 @, G) ]# u( C; }6 i2 l' w" h7 T# P! y3 x* C" ?- R, i
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
4 H9 l- h h7 E <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
8 F# J0 N6 k1 e9 r+ A7 D0 z "id" => $shortname."_addthis",8 [9 Y/ @/ N$ P# B: M$ B0 D2 E
"type" => "text",- J+ A9 c! Y& F* Y+ X
"box" => "social",2 w6 C' W% S/ M/ Q* o) T! m
"std" => "",
1 \' i: K H$ L: q% W" Z% O2 j3 x ),
# b8 J V* j% D: q( s) Y, {2 `: a. ~$ I1 @0 X
array( "name" => "</div></div>",
5 w+ k. s% A; t6 ~) ?' S "type" => "close",
/ Z' D" Z% g2 `0 T' h ),
8 J: A( f+ ~4 |) t0 K% }$ \) m
7 x3 o: }1 @; C3 H. Q
: {) n5 Y. p; q/ Q% M2 b6 Z$ Y
6 t8 O( n2 {- w% D) j9 D array( "name" => "YouTube Video Settings",/ T* S }4 G$ t$ i) ^9 s
"type" => "heading",
% Y% A3 C8 G" |1 @ ),
: _9 \6 w, i: [4 g' h9 K- c( b# R7 ^1 i% A
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
& j0 Z/ v6 x9 ~, k "id" => $shortname."_emvideo_activate",
8 S8 _6 @0 o" X$ Q "type" => "select",
3 m& |: ]& J5 i8 m "std" => "No",$ Q O: D1 J3 F: X0 V* Z
"options" => array("No", "Yes")),% G: Z; }. N& s! `
7 ?% |: D5 {1 A4 w0 S. E
array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",3 r8 `" U/ W q- k, U
"id" => $shortname."_emvideo"," D. e! J1 a* n* Q. s) u
"std" => "", J$ D) _ b6 |* {& w9 ~* k
"type" => "text"),- z! }5 ~7 u1 V
- X3 ^# |9 t9 J/ N array( "name" => "</div></div>", b# @, u" P* Q! q) B& r
"type" => "close",- d1 z' u" j$ v0 o: r
),
+ y7 \1 T" X7 g ! G- X, I- _- J# ]1 s( F
array( "name" => "Twitter Settings", r% j2 G5 I: b \& T0 e% M" A3 M& e
"type" => "heading",! U9 f) ^! B/ ?; f5 t2 N9 c1 S
),$ e7 t7 H' q7 S5 L N6 b# E
; ?& w% L8 O/ w4 v5 q3 P8 M array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
) }* t5 W/ k! N& L3 G9 N "id" => $shortname."_twitter_activate",: g# r* {( C) G3 I& m0 ~. q
"type" => "select",& f7 I- H1 n# L c" ^0 m R
"std" => "No",
: ~# I. I$ L1 _0 a) {# P" l: ~+ A "options" => array("No", "Yes")),+ y- R# B2 v& _# g' g& P% F' t
0 q( U& M* g* f4 I: d
array( "name" => "Insert Your Twitter ID here
8 c2 O6 N( X; s" D <br /><em>*leave blank if not necessary</em>
. Q& l$ k( E0 ^+ c0 S( t <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
! s) L0 _+ O5 w3 _ "id" => $shortname."_twitter",; o9 D9 e7 C2 H! h. l, X k+ s2 z
"type" => "text",7 t6 G$ y& O) V4 P
"box" => "social",
, f' a* ^. z& p7 A g$ ?: Q) A9 G "std" => "",
$ a, G2 k3 \; X0 m q9 B- Y; I ),
u" V+ s+ C2 q% {
1 g; q7 s: g& X9 d array( "name" => "Enter Twitter Feed Count here
2 m! ~, E0 O7 z+ s" z <br /><em>*leave blank if not necessary</em>
/ b" ]& R: b0 k! W6 m5 V <br /><em>*Enter How Many Twitter Feed To Display</em>",
! U6 u5 G2 u6 y# W, t "id" => $shortname."_twitter_count",, ]4 M- e: Y g* X8 D, Z+ L0 X
"type" => "text",* O( @+ Y @% V1 F0 _$ I ^; E1 l
"box" => "social",
, h+ `4 Y2 o) A$ T "std" => "",2 `8 d3 f b' b& v
),
# H! h0 o \$ w; ]; B( q8 }, r1 W3 o# Q8 \% j X9 R
array( "name" => "</div></div>",
$ A' `9 U% p" Y' F) n8 O8 e "type" => "close",1 ~) S6 e; j/ y3 ~4 ]
),/ p2 U! ^/ n" }. V( {+ |
; Q/ z3 B8 F' N% D2 y; s
6 R }+ _2 U( ^/ [$ p7 n0 t4 k array( "name" => "125 x 125 Banners Advertisement Settings",0 Q& Q8 ?' j! a6 ?- e" e ^3 x
"type" => "heading",
! [" Z- |1 ^8 w- B$ C2 [5 G/ W) | ),
1 p2 r+ H- E* i Q1 W- @" {( X
9 \' E4 [/ A9 [& Y% p, M+ u array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
$ M- H- k# g3 Y2 N& T# x "id" => $shortname."_sponsor_activate",
+ L' E6 u0 Q2 I0 ^ "type" => "select",( ^0 O9 {2 @. ^0 F; R; o" Z1 F u
"std" => "No",3 T3 U a; o6 x e' p
"options" => array("No", "Yes")),4 t' H* w* I6 Z& w! ~5 d
; z* i4 n8 i4 h' O" ` _
$ ^: D+ V1 s* ^9 a, e array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",$ N9 J# I! M! _. X/ p" v' Y
"id" => $shortname."_sponsor_banner_one",4 @$ M, ?% o/ }$ |
"type" => "textarea",
$ B2 |5 t+ A. D( ], k: f "std" => "",8 T' |% r. z; v, ]* n& i
), 9 Y2 W$ ^7 |# {: A+ s+ r; z7 W/ D
- y$ S ^; i" ^! f9 N" O* m
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
$ S: v7 D/ r2 b. x: c "id" => $shortname."_sponsor_banner_two",
# `! q5 ?5 m( ~ "type" => "textarea",
6 c5 k2 g7 X# v9 p "std" => "",
9 f1 [' C+ u( r0 J8 P ),
" }9 K8 T4 v) H% }: ?2 v8 {+ m1 Z# I5 \8 g, D
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
( |% b. A! ?% X& q "id" => $shortname."_sponsor_banner_three",2 [4 @2 f! v# M' L6 v
"type" => "textarea",% A* H. V- _, U
"std" => "",
" F7 [! u8 M/ ?* p ),( s/ Y3 I9 Q1 W: M, e* V
$ {& _2 N( s* x& o& i7 [/ }" i array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
% {% ?* C4 S& J. `0 |, l& z "id" => $shortname."_sponsor_banner_four",; O. I* x4 @3 ?- e4 u
"type" => "textarea",
% l }# ]1 ^ t' i8 I+ t. i: b- @ "std" => "",. Q g v: J8 M# X9 K
),
7 f' R) m+ [1 X3 Q# z [9 [4 s/ X ]8 g
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
& e5 ~4 a5 L6 { "id" => $shortname."_sponsor_banner_five",% S* I8 B3 m, }# W! P# _0 \9 \' J
"type" => "textarea",
5 U- c* ~7 k& Y. s "std" => "",3 R5 J7 o a/ u9 u- Q. u* G
),
9 K% C- b2 Q3 _4 `+ l: B) Y. [% ?* b6 u0 S3 ^0 S) J, E1 d( O& i
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",0 L" b; t+ E: n& ^6 |8 t
"id" => $shortname."_sponsor_banner_six",
6 `8 \' a) J1 I* U) Q. A "type" => "textarea",( D$ K* G) o) |/ Y
"std" => "",( g: ^: i5 t7 c0 }+ ~
),
& S& o8 o; ~- `2 a6 P/ p2 G8 O1 u2 @ \
array( "name" => "</div></div>",
# Z$ f5 |" O+ |# K# |& A "type" => "close",' h: _4 _7 z3 g- P5 V# C
),4 \" c" n8 d- w' [ G: [
: m7 D) B8 ?9 M( a {
) n5 ~, m! l8 F2 b7 S. V+ v6 \, k4 r
);
: L# N, _8 J" m" V; y0 x% ]( H
. Z% H6 l6 l% v, Sfunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
/ {2 u; L2 L4 {: _
2 b0 ^" S5 O9 ?( Gecho "<div id=\"admin-options\"> ";; B1 l7 w+ a+ S D$ r
: f0 }6 u% l/ {; [$ p9 W
global $themename, $shortname, $options; m* D0 Z/ [8 N" m1 d
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
/ s L& k+ i8 N% C% }8 r& @if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';) H8 t2 r: k" {$ G
?>. \4 {; `" w& `. D+ W
b) ? M; U. N$ @- h7 Z0 m$ u
<h4><?php echo "$themename"; ?> Theme Options</h4>
/ t5 t b# Z: o4 O
- M8 p. D: I: U& G8 Q ^<div class="annouce">0 y% z% k7 b, C' H
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>7 e# {" p, l5 D0 m8 w
<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>% n Z: ^/ N6 N5 J
</div>
) Y% u' B& d& H, A C! D k4 F! v! b L8 X4 j$ k
<form action="" method="post">
0 u4 e, @ N) M4 X9 i! e9 z. ~# F2 `' x# R# }4 b6 c
<?php foreach ($options as $value) { ?>9 E9 C% C6 P. a6 R4 g
4 u6 z/ z* m3 ~# c8 N
<?php switch ( $value['type'] ) { case 'heading': ?>
* w5 l5 i" g3 B& q: [, m
+ o p6 {1 o2 i% ^2 Q<div class="get-option">
3 H- U& C" d: e Q. t
3 m) Y, H7 R: r5 }% b5 v<h2><?php echo $value['name']; ?></h2>- p3 p7 a D& ]! x, A+ ?
# G9 D* d: b" [/ |) Y2 F<div class="option-save">2 \6 `; _0 E `# J4 U$ q; H# H
1 ?: R6 a- |, Q. }$ b. X5 ^3 D<?php) J3 f5 _, Y: K4 g& x5 L
break;9 ^: n! p, V) r6 z+ h! W
case 'text':
* w( e5 p+ G- {2 I4 ^5 Q) `?>: I; \' g! D+ S# Q/ `2 i
( K& H- T. x) d; @# Z<div class="description"><?php echo $value['name']; ?></div>: Q9 \: k8 u6 Y2 q9 d2 K. c- W
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (% ]/ r+ {9 n5 O3 @8 i, Z
/ x5 O) h h9 s) Yget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p> z& b7 d1 b5 ~! `& C; i: y8 ]
6 V1 O5 S( Y* a {
<?php
* t; s5 S! g* ^! G/ T0 {break;& o* q8 W& n: `2 q& x4 n& O
case 'select':. n' {. m7 Q5 [* I" i
?>
3 I( d2 r$ |; f, I- Q8 C7 V) {
, K8 J7 b/ M% i<div class="description"><?php echo $value['name']; ?></div>2 C! A( |3 A& f4 {& x2 L; T
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">7 J0 U" g- ^0 Y& _/ S0 |' m
<?php foreach ($value['options'] as $option) { ?>
: M- o; _ [! H+ @0 j% [9 |, W$ ~" I' v<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
# J# q' m- _8 u2 L. ~/ `9 A<?php } ?>7 _3 R7 j: z! p4 V% G7 ?, i" u
</select>" t6 Z# @; U. B
</p>
. W+ m* X+ O) P( @, M! B
* {7 b6 U: \2 B* z. F+ ?<?php
; k* N3 |- h, ?+ p1 Abreak;6 W' {. H7 ^% j1 d9 N& k) w
case 'textarea':
L( t' T$ B' \. R, u# |4 ~+ F$valuex = $value['id'];7 b/ n X. q9 v+ G7 R
$valuey = stripslashes($valuex);/ x, z7 ~. c5 r9 M( Z% w
$video_code = get_settings($valuey);1 s3 [0 h- L- H3 _* V# e
?>
6 q+ l& B- u5 i3 ^& T& C! |7 o! w- p6 {$ N0 }; U0 }
<div class="description"><?php echo $value['name']; ?></div>0 i2 [( Q7 O- g5 t
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
( E8 x( e% |9 e/ S4 I* y; F& I S% @( r( ~, Z$ K
else { echo $value['std']; } ?></textarea></p>8 e# F. i! D# [6 \6 Q
) Y7 V: W' [7 P
<?php
9 ?. L! Q' @( D: w, s }1 Gbreak;- r& r5 p# I7 t! h2 e
case 'close':
3 t6 X1 u h& ^9 m" P$ ]?>
: {) p3 u# P% y- Q9 V/ ~3 ]/ A, H* P/ A$ c& n/ A
<div class="clearfix"></div>
* w$ S9 p: I4 Y3 @; U</div><!-- OPTION SAVE END -->
* @% L* X) h! y F7 V* C5 a
& o5 W" Q, W+ B# ?( [<div class="clearfix"></div>* I- G- o0 \; J' ?- M5 @+ L
</div><!-- GET OPTION END -->
! Y) X p# |, L5 C$ J! B# ~& E1 s& W; W# A6 s) Q
<?php1 l+ i' f3 ?! O( y/ c
break;
0 x1 T( ]( A0 U8 ~( E% x1 Jdefault;# J, I/ {) ?7 e3 H5 d# Z5 L8 D
?>6 @7 Z: F6 x O$ {6 \
! m% }+ N, X6 J7 @" S: d3 U: C
/ ^ Z% t" n4 n7 e; b<?php3 h* B9 X. s7 _! L( L1 L
break; } ?>1 N8 P9 v! ?5 `, p* h' j1 r
q& P; M. D' D$ G$ s' ]( H<?php } ?>
% D. [% n3 T! z4 `& H+ i- z( T: C+ m7 _
<p class="save-p">
( c( p% I* \& c6 R; o& l! a3 [) y<input name="save" type="submit" class="sbutton" value="Save Options" />
. ` h$ y Q" Z" ~# p* m. d<input type="hidden" name="action" value="save" />" j. l$ u2 G/ _0 X) a
</p>
2 l% j. K/ ~" B</form>
' I. p; @9 O/ I7 @5 W2 N+ Y- Y: T' G: V2 f/ Z0 |
<form method="post">) T& s8 m, a5 P) {
<p class="save-p">
* P$ E y. J3 Y/ X<input name="reset" type="submit" class="sbutton" value="Reset Options" />
' U5 e6 Q A. o; G+ {, J, h<input type="hidden" name="action" value="reset" />1 l6 b5 A+ M) o! i2 l# C+ E6 b
</p>8 ~1 M- @: ?, }2 B A2 s& G! t K9 [, m% ?
</form>) M) U4 A# F4 s
5 f% b0 [# S- w T0 E</div><!-- ADMIN OPTIONS END -->
# b7 B9 d0 P y7 e7 d7 C# W8 b0 b
- G4 D3 D1 I v/ A<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } } {/ K2 ]3 N2 t J$ w# ?
7 G$ b. X @: D
function mytheme_admin_register() {
( K, G/ Z5 q' D' Z- ~' n$ Fglobal $themename, $shortname, $options;
/ @1 k! S' Z+ L( Jif ( $_GET['page'] == basename(__FILE__) ) {3 s4 d7 _' U+ M7 P+ W
if ( 'save' == $_REQUEST['action'] ) {) W6 E* \; M% f+ \6 u1 m3 ]
foreach ($options as $value) {
2 j* `) K* z. @. ?, Wupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }2 T' Q: e8 D3 r8 A
foreach ($options as $value) {) D1 d7 L5 ` h, f+ U) C, K
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }8 m7 P) v+ W/ [/ I5 H
header("Location: themes.php?page=functions.php&saved=true");0 V4 r$ d8 x2 p7 l5 J5 {
die;
6 Y5 Q2 \7 q5 q# m; f} else if( 'reset' == $_REQUEST['action'] ) {
0 x+ H$ R3 c2 P) |! Y1 p$ \foreach ($options as $value) {
3 o' K& |) W' G5 m' V. S" ~4 l' ndelete_option( $value['id'] ); }
. ^5 C! S* {2 S1 {! H. f' A) uheader("Location: themes.php?page=functions.php&reset=true");" D: J& [ X/ _8 l- v" ]' e$ b9 z
die; u5 `1 d' x. D1 n5 p2 `. r& S
}* F" @! e! P6 l' g
}2 w1 W5 r: `( V* X3 Q
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');+ N% ?8 u+ b/ ~' B( ^
}" M% {* B( S7 z5 L* U
' ~) W$ W; i5 W" @8 O Ofunction mytheme_admin_head() { ?>
- D% f# K. W% e9 v, _, q e<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
a8 h" ]4 [. @& M1 s9 [<?php }' Q) f5 G) |1 v! S0 o5 P
|
|