|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
+ `' k' T9 ~# I8 c5 r* {// Theme Option
' F3 O% \, y9 f @+ O% ^7 f////////////////////////////////////////////////////////////////////////////////6 T/ X' m$ i( t" [
! G& Z5 }* X8 v, O1 g$ w4 a
$themename = "Zenx";
8 T! j! s: P) H# D$shortname = str_replace(' ', '_', strtolower($themename));( O& g8 r( y B/ y- ]
- y6 |# S( c# y. L8 I* Hfunction get_theme_option($option)
6 V. o7 z6 J4 x0 {- z) H. Z+ p{
k. U# L M+ M5 I k* x x global $shortname;% t5 Z% [( D/ A$ }7 K7 O+ S
return stripslashes(get_option($shortname . '_' . $option));
% i" c2 G% N( z# B2 B! @}7 n2 h; e* b! R
2 y2 F6 G" Z. ~5 A
function get_theme_settings($option)
( ^! s4 ?, \8 ~3 I# t{
+ s2 C2 V5 V/ f- f: p8 I' ~6 b, q. Z return stripslashes(get_option($option));3 C5 D5 \! M* b' R9 p+ O
}+ Q" t1 b% B f+ q
$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");
3 a6 `4 y7 ], S* @0 o6 p. G$wp_getcat = array();. }6 }4 ^* k) k$ w& X
foreach ($wp_dropdown_rd_admin as $category_list) {+ _5 w# H+ P5 ?8 T
$wp_getcat[$category_list->term_id] = $category_list->name;3 |2 O( [9 J( e0 E8 p
}
, Z+ E b9 l# k- w1 p1 [$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
j# ]3 D% H$ d# B. c- [' A$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");, f) m' v" j& n' }) \7 \
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");& d$ J) E5 G, ? Y1 g" q
2 M: o& v$ f) Q$ l' Z8 _
$options = array (
' i% _9 S% z2 p0 P' [" P+ P: E8 b
, Y1 |* @" i8 q# \1 o! a$ h- L, \! _" V
array( "name" => "Blog Header Settings",5 \5 Z, B, P: Y
"type" => "heading",* I5 v- Q4 y* r6 D
)," n- ^' l7 n& \) u# U& o9 X
: T) Q: h7 d; z5 B0 x# B3 s array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
( }1 }6 j7 V# j& z0 g. L1 S. Z "id" => $shortname."_header_logo_activate",/ ?5 Q; Q7 y1 k( M" i) O! p4 _
"type" => "select",
% q3 a+ d* {$ |$ [ "std" => "No",
5 h" f2 y+ k E "options" => array("No", "Yes")),7 A' a3 F2 L! }, r! B
8 U y3 D, B8 @( R- S: ?3 u
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
# o/ u @' W% f1 c "id" => $shortname."_logo_url",- k& [2 u, r# A3 H6 V+ ^# n; `
"type" => "text",! D6 O: M+ T* J0 c/ ~
"box" => "social",( M; R8 p: C! c h! X ]+ v$ P
"std" => "",7 H5 ~( b. J0 d Z& g. S" n1 r
),
# h) ?8 P; F0 @
3 x7 }9 L. a# _& H$ J. o/ ]. ` array( "name" => "Insert Header Banner HTML Code (Header)
: f% V5 _+ Q0 J <br /><em>*Recommended Size 468 x 60</em>
# ]% f# U1 W, T; {! y2 ` <br /><em>*leave blank if not use</em>",: f) m9 K" s4 C7 e; W! X
"id" => $shortname."_header_banner", r7 n3 h* L# \
"type" => "textarea",
. ~; t) h( \9 x; F "std" => "",, I' E0 P5 c) w$ e7 k
),
1 }0 q& R9 m) k- {8 l% @- Z" Z$ ]" o" J
array( "name" => "</div></div>",+ ^' _1 K2 a9 J7 I8 b( e) }; ~+ o
"type" => "close", @( o- a& m8 x' h- `1 M% J
),
2 H' ], |* U* W3 k# s. v1 I9 N( I* z; H3 f# [
) Q' M( B `( |0 U) E/ Y! d4 @
array( "name" => "Header Navigation Settings",
: ?/ ~( g5 w' ~ w "type" => "heading",' j5 O8 I7 V4 p/ J7 Y! H
),
; t: e, |+ j0 L" @4 B; r! R# x
8 T5 p3 f6 W: M1 ?; D array( "name" => "Insert Page ID To Exclude On Header Navigation<br />: G& w9 a( h+ y: p% I: @( L
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />/ F* I6 U$ N5 M" H
<em>*Enter the page post ID number only</em><br />
3 P. V" t! [" i% S" I$ i R1 g <em>*separate by comma</em><br />
) g- M. C5 y0 M( F2 i% H! q2 S1 P# f <em>*Exclude pages which you don't want to show on the header navigation</em>",
" Z. s3 q) v" d& Q "id" => $shortname."_header_page_navigation",8 q G0 I+ k4 P! Z& j# }
"type" => "text",
$ i _' `% q; X, r9 z "std" => "",. t$ b: U4 u7 h
),* q$ p# Q( \) D! z
. d1 [* G: m' E& Y0 g# p; c array( "name" => "</div></div>",
+ A ?1 v2 p4 A "type" => "close",
* u9 x, d/ \4 e ),
' T- g8 U9 A6 o( { 1 Y/ p2 v5 N6 ?: ?
E: u, q5 o$ b. E
array( "name" => "Post Auto Thumbnails Settings",
9 W3 w# j' ? n "type" => "heading",
. q; F' k3 r( C! R. `# k' W ),
) G* G0 S, B/ v+ h% m9 F * |7 E6 H$ V- m e
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",6 ~; ]6 U7 l H# E6 |* b6 {) V/ p
"id" => $shortname."_timthumb_activate",
/ E6 k0 b5 k$ a) e7 v "type" => "select",
/ q% l! p1 @' n "std" => "No",* U' A$ [ B5 O9 i, r! v8 R0 a/ s
"options" => array("No", "Yes")),6 a0 {" L7 t! w- O8 {. p
6 U2 ?. X3 J" I. j$ | array( "name" => "If Timthumb is enabled, Please choose its cropping method",
6 k% R: E. i; n, _ "id" => $shortname."_timthumb_cropping",
# g0 x; H) J7 Y/ l8 W2 ~6 J' x- B: c "type" => "select",3 b7 {4 D0 N+ k2 W
"std" => "",
" z& C3 J- g# u* Y; t) u8 _5 D "options" => $crop_position),
7 C2 j: V! U/ t1 _5 K2 H& l+ d$ A* N4 @$ {
array( "name" => "Insert Width Of Thumbnail Image<br />9 A: ?& b9 }6 p
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
" c: s4 o8 l. H/ X3 W& K1 W. c% l( f <em>*Leave Blank To Use Default: 250</em><br />",; Q" `* f, N }
"id" => $shortname."_thumb_width",3 D) T' t5 Z8 Z5 l
"type" => "text",% o+ F& U. {8 |/ e: d( ^
"std" => "",) r6 r6 S, f6 b- {
),
2 L n6 v p& o" V5 ^8 a
% b: C9 q- L1 H* _ array( "name" => "Insert Height Of Thumbnail Image<br />
" p7 C( [0 H( U. r; ]2 B d3 V2 q <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />$ f' `/ l( `2 N9 t9 @8 C2 g
<em>*Leave Blank To Use Default: 200</em><br />",/ F8 r; P( e8 [ r; |* u7 c7 E
"id" => $shortname."_thumb_height",
3 \$ D, S6 N d: E( y "type" => "text",( W3 W9 M( {2 Z& h/ M1 s/ N
"std" => "",* C1 B# _( L8 z D2 P+ W/ x
),' C# W9 |/ n; G8 H
5 s, S ]4 W. t8 V array( "name" => "</div></div>",
5 y4 ^7 y5 V |* @ j6 O" \ "type" => "close",
, k, _4 c6 Z: k( B7 U/ e/ m* _6 G ),$ y/ {: `4 L: C6 S# k1 x/ E. M
" X$ `; z' g) x
array( "name" => "Featured Content Slider Settings",
r% n: M( v0 t8 c9 F# o l1 O "type" => "heading",
' F; W$ W: l0 e/ t; q ),5 F) V3 l6 ?' f) N$ f7 k; t
9 Y7 s- v, ?, b# S' v& k
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
( Z ?& u7 }9 a8 I "id" => $shortname."_featured_activate",% U0 ]0 j9 \! U* ?. P" J# {# p
"type" => "select",% l* c) ~2 x V" s8 Z5 v( _
"std" => "No",4 j0 z R2 f3 G* a
"options" => array("No", "Yes")),
8 |0 B6 \0 M3 n2 X; O! g% z, h d! I/ s4 {5 K& e1 K
4 N4 R, P/ y2 c array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
8 j& Q2 \/ Q; G! Y+ | "id" => $shortname."_featured_category",# Z6 c2 O! e/ K0 G
"type" => "select",
8 y) o/ G) m. u% P& D$ d6 I "std" => "Choose a category:",
( M: `' \, X! A4 d* Q( N. @& A "options" => $wp_getcat),
- A2 m, u5 Z( w7 k w7 F$ o
! M9 x A# g7 p. {! K5 }- M array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
/ C$ L, a8 N+ ?3 H7 j "id" => $shortname."_featured_number",4 [% Y2 q1 S+ N$ T9 }0 P) E% e0 ~
"type" => "select",1 @& k, j0 p7 U5 ?# {/ s2 R
"std" => "Number of post:",
( t5 n# O% \( O/ p/ E. E "options" => $number_entries),
$ a! O! g% Z, u. D8 H8 a5 n" |1 B+ b% g1 B/ K( N6 e) V" p
array( "name" => "</div></div>",; B: G& M; s: z, Y& C
"type" => "close",
/ j3 [2 g, P, G) @ ),
1 P- U# _: x) L+ q; @( c( I' V* \
8 t- r8 ?8 R/ u* h' \ array( "name" => "Featured Category Settings",) f* R) B$ B0 H+ S! ^
"type" => "heading",
+ ?; H/ n- l' I9 b ),8 ], b) ~$ ?) A7 S" y
$ b! Q2 Y6 |8 e" J/ `7 O
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>", `4 y; W/ C! d- M% u
"id" => $shortname."_featured_category_activate",
+ b/ T: n# a4 o' _ "type" => "select",
# f1 e4 @9 h: W; F9 v j* } "std" => "No",
4 h3 X3 [$ s) k0 d4 M8 ~ "options" => array("No", "Yes")),6 X; K% R1 T, C' X: }0 _, s
7 Q: t) k; n7 p' [ array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
: m% k- |2 B9 T; y "id" => $shortname."_featured_category_id1",/ P% s! h, C# s4 @! q- b
"type" => "select",
: Z! ^, x$ o- b+ N. J' Z "std" => "Choose a category:",
! p4 e- Q& m! Q3 P' Q1 U% k "options" => $wp_getcat),
& {: j' ^3 b D) \
( P6 q) W1 E e5 {$ c array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
7 i* P3 c" ]$ [3 \* \2 i( r+ I "id" => $shortname."_featured_number1",% P ~ o8 _* V) G! v! K% g
"type" => "select",
0 n. o- I) L8 {' J" V5 `. z I A "std" => "Number of post:",# ^+ v& t$ `- X, h4 H
"options" => $number_entries),
, \. k7 ~3 M/ g) m% C& `( ?# ]
3 F' w" Y3 \6 u) A2 n, @/ E array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>"," [6 d/ s0 }7 d
"id" => $shortname."_featured_category_id2",$ g& }. x8 g7 C9 K2 y3 b5 n$ v
"type" => "select",
& V( P* P% T5 I( \9 Q% u "std" => "Choose a category:",
0 ?2 `" r( n% h5 n "options" => $wp_getcat),# A! Q6 s+ t0 E2 e7 R5 h k/ e
2 ^4 z/ j3 d/ y9 G5 L. w2 N, y
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
g4 ~: X, l( g$ P. F# J; |2 I5 a$ H# V& y "id" => $shortname."_featured_number2",. z+ Y: H0 \2 m, k" u2 _" O
"type" => "select",; j" t* a9 B8 Z( S! k. P
"std" => "Number of post:",
/ O; s' Q% }8 A ^+ Z3 ]% a! _ "options" => $number_entries), q8 d1 p+ J+ |/ l& ? u: P
4 g2 a' l1 s3 \ + w9 L: q$ \% I1 m* r% V+ n _
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
# p5 X- r+ o% m0 D7 L2 f' D5 _1 D "id" => $shortname."_featured_category_id3",; R5 L; m/ P: m# u
"type" => "select",
A" _, j- F O "std" => "Choose a category:",5 |$ |2 D3 K8 [( k
"options" => $wp_getcat),7 S4 P, o! r: |
$ w O, _0 ?/ Z3 a1 H, m array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",6 y3 ?' C/ P) A1 ^
"id" => $shortname."_featured_number3",
! v( z- e, s% a8 E" P7 e "type" => "select",
7 u8 L/ W$ W, B! X* x$ M/ | "std" => "Number of post:",! T% B" `3 z; G3 y6 G4 A9 O* u
"options" => $number_entries),1 {" ^, u- h+ U
, y+ ^$ F& O+ q
( K" R; [6 p5 x0 v" L$ F( Q% e) p array( "name" => "</div></div>",
1 s+ Z G9 O" U# O( t8 p "type" => "close",! P$ o e% Y6 `5 R2 T: ]
),
1 K8 C- h7 c$ N; i) Z5 J4 }3 ~/ \' I: m1 ^& K3 ^' Y$ _
' `7 ~" S- h# Q, ~3 Q* e array( "name" => "Google Adsense & Analytics Settings",
$ K# K9 w& ^" ^0 F0 n$ ] "type" => "heading",. {6 M3 |$ X+ P w# r
),
! R, E4 J8 x1 |! Q# {( E: V& w6 Z% }+ G2 m5 } z9 Z. ?! B. h
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
& y- h7 Q% E; U6 S1 ^) H "id" => $shortname."_adsense_loop_activate",
$ o8 Y; O0 ]0 ]9 v4 \' Z- H "type" => "select",; S! p' U: q5 x% o$ O
"std" => "Disable",5 @# C) Q3 ?/ |, v1 O/ C4 N
"options" => array("Disable", "Enable")),* a0 L: k$ f# M
6 O) \( U" V- i/ R, v$ Z8 c2 r/ ?& n array( "name" => "Insert Google Adsense Code For Loops Here<br />
! G( g1 [3 e) ^ <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
3 ~9 ^ {' o( a3 n1 k: x "id" => $shortname."_adsense_loop",3 u# d- E' O! @' K. X* F w% B4 j
"type" => "textarea",
2 l, k S. e; H( A "std" => "",4 u U9 ?5 c- z* X g
),, Z5 g2 [& o9 G; A
1 A* J K0 [# M array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
/ T1 h: A1 t. ?# r+ l: M "id" => $shortname."_adsense_single_activate",
E Z+ \: t* l6 p# \, I( v "type" => "select",) C0 q9 ]- M/ x6 v) l# j l( q5 y
"std" => "Disable",- b* @8 m8 v; y$ m; h! ^! S
"options" => array("Disable", "Enable")),3 Y- n4 W4 H. { m$ [
; g8 m6 ^2 x( b* J array( "name" => "Insert Google Adsense Code For Single Page Here<br />* ^# G; W+ S" S5 J$ D
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",: d1 R' \- |; ?: q3 i9 @! V
"id" => $shortname."_adsense_single",
& |0 T: {$ w1 x' a# C "type" => "textarea",* k* E( j2 r$ X4 T3 I
"std" => "",/ u: v- E% T7 r9 {0 L. d& F @3 q
),
0 [5 ~* r" g- h/ Y3 {4 G% c9 H5 {& Y0 ^/ r |7 g1 U/ x
9 ^+ I5 m- V8 v8 f( M" y* T( R0 l
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
# X# L$ q/ j* v0 o "id" => $shortname."_google_analytics",+ O( V1 C- {. F. J* [0 a" ^5 R
"type" => "textarea",
* H* ~9 |" Q9 d "std" => "",, N' s: y* i+ f! \2 r
),' s: A" ?. r- b7 W
$ c9 T/ ~" {/ u/ K7 ]: h* Y' a array( "name" => "</div></div>",5 V2 G6 N' u* A
"type" => "close",
3 Q9 Y$ x- ^" i ),
! c9 }' d5 D1 d: C8 j- x
8 b: N; p7 Z: K9 a4 }' D: U* o
0 F9 u; @0 {' R0 c array( "name" => "AddThis Social Bookmarking Settings",/ Z. h0 W" w' J" Z) A, O F0 V J
"type" => "heading",5 e4 l7 e! T/ N" N4 D
),+ |# y" t% T( f
, }/ C. |/ e; b8 S array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
1 Z( a% @* m! j8 B. ?' |/ a& I5 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>",
" {9 f5 u0 {7 |5 Q" f3 U "id" => $shortname."_addthis",
& J, @ E' O* Z7 G& u+ n "type" => "text",
, C3 I+ Q4 n4 a8 l "box" => "social",
/ M6 t" ]% r* ~ S) M "std" => "",
" `9 r2 c# ?$ F3 {, I- R ),- c" B& e+ H* \; I8 I* X; j' |
1 L4 R# H `! U
array( "name" => "</div></div>",
6 {7 p" P' a8 v0 e1 m. L9 Y "type" => "close",
, c Y5 s3 H) S7 P0 d ),
9 p/ w1 P0 J6 k, v2 b
6 h; s* ^) ? k# m2 Z( I& E7 n7 Y
) E3 S& \! q& \
3 Z* q V' o2 q3 A: s array( "name" => "YouTube Video Settings",3 e. c) X+ }. C0 I
"type" => "heading",
' U7 n" Y Q2 [# X- D ),
. M6 `5 c6 F6 }( L6 f5 D: n' I5 Q( v' ?" A( R, E" a+ s$ O7 P
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",! o) y' S I/ p8 R( \% R- `. M
"id" => $shortname."_emvideo_activate",7 g' N6 R. G6 f. a- [* Q
"type" => "select",
, I9 n8 b5 f* l" w" T: P "std" => "No",
3 V1 y# m2 s. x: ~ "options" => array("No", "Yes")),4 B& I. b/ m$ {, h1 b, f
% b- B( O2 P/ _3 ~' R6 @! K 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>",
. v& l9 q$ Q3 `1 o "id" => $shortname."_emvideo",+ R& s* ~ P! R9 }' K" K2 ~
"std" => "",
W. w* N6 ^ {2 T" ? "type" => "text"),3 B. i6 ]7 U) E
8 m; a- ?& g& U% l
array( "name" => "</div></div>",* e; V& D5 @8 S, Z; @
"type" => "close",; _; X; G8 _: w3 Q7 `$ H2 h
),- ~) Y' L: g9 a9 q
2 ~8 C5 v5 s5 ? array( "name" => "Twitter Settings",
+ `1 L" t8 D3 u( w/ A* r "type" => "heading",$ w$ h& e4 l5 N
),- A: m6 o; h) v# R$ d6 n
: A% i& F" n9 x! c+ J
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
) l4 y# @; U6 y+ ^# d2 i3 u "id" => $shortname."_twitter_activate",
9 ^1 i$ R- `, S% t7 y3 N# l7 b "type" => "select",
6 @ T( q2 E. T Q8 a, n/ Z "std" => "No",
" g. k+ c- `! V! z0 f3 | "options" => array("No", "Yes")),
6 D' \* w4 Y3 G1 r4 Y
! s9 F1 r- _% k- t) N0 L array( "name" => "Insert Your Twitter ID here
( l8 i p$ @- i <br /><em>*leave blank if not necessary</em>0 r4 c' X/ g9 x% s R9 q
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
: W; \9 e) j# p- E3 h) _( G "id" => $shortname."_twitter",
1 U$ ^% f: E' p0 D% \. s0 { "type" => "text",. |6 y' A/ ?* B+ F0 _# Z* e+ |8 Y
"box" => "social",; Q. Q: x" r# [. Z, d
"std" => "",& h6 w# j8 D8 C4 V
),, H" |0 D5 z, v, ?7 w& ~ ]& j
* {. P. Q2 `/ ]3 E4 l9 Q
array( "name" => "Enter Twitter Feed Count here; }9 c6 n8 z7 ~4 H' b3 |
<br /><em>*leave blank if not necessary</em>2 R- I7 S. B- L6 b
<br /><em>*Enter How Many Twitter Feed To Display</em>",4 ~ X' x/ ]' ]! s9 n% w
"id" => $shortname."_twitter_count",
4 L8 v# r9 t. E( o "type" => "text",, R. S+ z4 [) I$ o6 q
"box" => "social",
7 z9 t- q6 b0 p3 @ "std" => "",7 A# z/ f6 b( f
),
0 H8 d, h) l; G8 Y( D
6 {; {# e# r' D2 u# I array( "name" => "</div></div>",
# j, G, A( m6 r2 G# e "type" => "close",
- s$ j( l# P4 r- @ ?4 | ),/ H( R1 H4 A' K0 } u6 o
) o( f8 Y4 J5 A& Z x2 s ~, A7 y& c. z2 F* s
array( "name" => "125 x 125 Banners Advertisement Settings",5 d+ |* x' d: A! {9 |& H" {9 X8 _
"type" => "heading",
0 }. g9 d) f7 q" G# [$ X3 \ ),
: m6 C( j: p% p' m/ x 0 ?0 P; [1 [6 y* r$ {/ s
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",5 `. y0 Q5 E( e/ y2 f! ~8 z% D7 q
"id" => $shortname."_sponsor_activate",
& f1 E5 p7 r; Y2 x "type" => "select",% d; M8 M& s. s
"std" => "No",
v1 A$ C: T1 S( |' y "options" => array("No", "Yes")),0 \; I) N1 }4 o& b& |: h# ~+ |: q
3 S9 i* q" K! r6 e- ?
4 [8 x+ f2 Y P2 I' y2 | array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",3 @- U2 K' L) S: a% E! N$ F+ d! s2 g* U2 r
"id" => $shortname."_sponsor_banner_one",
) K/ @3 w% r5 G "type" => "textarea",
( T/ p4 {; p8 W( O$ b "std" => "",/ t" l' x2 v! L1 Y+ c. f% ?
),
; n) [, ~0 {; \( P$ i7 h0 d1 R. X) J3 }
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",; b1 v5 a) k/ b( v1 d
"id" => $shortname."_sponsor_banner_two", L. a9 p0 ^( ]. W( {
"type" => "textarea",
& E+ B1 ?* g3 Y) e& f* j5 w! e% L n "std" => "",7 e0 Z7 N3 F! Q
),, F! w: a+ r3 W, p5 n
& l# w3 D! q P/ M; _
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
' _8 ? B# l4 _ "id" => $shortname."_sponsor_banner_three",7 r' } D) R. j2 S) Y. L2 J
"type" => "textarea",4 Y& J; h) Z$ \* a
"std" => "",
% ?3 X" L& ^' y6 k3 b1 B ),
7 T) ^7 V7 q1 E; o( d. P/ ^# e S) P; v7 E3 J6 d; {! U
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",% J7 J- A* g/ d8 ~
"id" => $shortname."_sponsor_banner_four",) @$ P) y! h+ N) c! J: }8 B# |$ }
"type" => "textarea", c! o6 m( e( I4 I
"std" => ""," n( f' }1 [. Q, s; R: l/ ^9 s4 j
),2 {5 E9 h( V B; b$ x, F O
: P2 r# K& ~! X array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
) L7 Z+ t! Z1 Q, \/ _ h# C4 ] "id" => $shortname."_sponsor_banner_five",' I3 |' K3 C! @2 L @8 u
"type" => "textarea",7 ^1 P6 ]3 u, v; H% i: j) i
"std" => "",6 d- [0 N' g7 t; O) Y7 |' j
),
7 D6 s l; h8 x) D9 d0 H' Z7 k* n, i: f
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
* O$ k8 d0 c( h# _" Q% P# c "id" => $shortname."_sponsor_banner_six",# Z2 k' J7 I6 Q9 o x
"type" => "textarea",2 i9 b& b7 h! w+ y
"std" => "",. Y; B! }; }) z6 F2 [7 T
),
5 ] T5 h9 C9 `. f3 k
8 R; Z9 d) W8 T: e: G array( "name" => "</div></div>",
9 S7 y# U2 s0 ~% ?6 y "type" => "close",
2 M* m# P' W. Z ),
. _ N4 K7 A; T5 b- l
0 O# ]; E: s& U: i3 E6 G( P4 a/ G/ p" R+ j* j: x
; {+ X* M, [+ u& l4 z- s: J- { });
7 J# s' i7 r/ c
8 b: m0 c0 z: w3 Q E& gfunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {2 |( R0 k b9 a5 k
* Y1 ~! N: g" _, E# s; z! {echo "<div id=\"admin-options\"> ";1 {) R# D5 E+ _) k! j2 |
: w% p# {) c% q# P! C
global $themename, $shortname, $options;
3 Y S r- A, o$ x, u1 N$ \4 V, |. @if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
9 h7 D/ J& l7 O* O" ]3 S, Fif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
8 N- `, \0 V; E6 Z/ Z( ]# F" x; N?>. y1 C( S4 W$ X. c" i# @ K
. h4 @/ ^! f j% @$ v+ n<h4><?php echo "$themename"; ?> Theme Options</h4>
1 j, y# L6 s6 Z2 F) c* |. J9 c" k5 W5 E) E& }$ U% }, w2 Y
<div class="annouce">
8 T3 w Z! q0 N6 C<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>4 t8 h2 W5 l# } c* 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>
* _, p) ^& E2 f/ k. n+ k" t</div>
8 b' W- m+ Z" }& Y, h& E
4 j4 j# N! z& N* A<form action="" method="post">
7 M3 o8 t i9 x& R/ \: D
, J$ T3 a$ u4 H- f: @<?php foreach ($options as $value) { ?>1 a' t, R! q5 v2 |. G: O! j5 B. O
9 R6 m( H" i( I, G8 R<?php switch ( $value['type'] ) { case 'heading': ?>
% `5 H0 q o% S0 r1 S" U# R) n* ? e$ a5 w0 _
<div class="get-option">
4 B% f; E" A! E$ K4 S5 M8 _% l
: d: M' s; X/ S. B# n% }( a<h2><?php echo $value['name']; ?></h2>
& p& X- t% n- O X+ V- |7 ]* I |1 P% s0 k. T V& _7 ^
<div class="option-save">' V1 ~! D% `5 C- i3 F, R
; V7 q% Z4 R4 P' p4 j6 A
<?php
6 z, K0 I, @( W) H9 ~" b* W8 }break;
' ?9 {8 K) j) m7 icase 'text':6 B; V# f# o+ J+ h
?>
2 z( `8 J" R E- Q' x8 S( V. T" J8 J4 h( v8 e6 O
<div class="description"><?php echo $value['name']; ?></div>
* ^2 t) G/ T; N1 r5 w- T<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
8 o @0 J$ Y% n9 Z% F
: t5 C% |: w% I% a+ {get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>0 y, k9 i! L6 O3 c7 C; K* `9 ]
6 Z' Q: L2 Q, z" [6 o& M
<?php
o2 C/ F9 v0 n5 Q% S6 Y+ C1 c3 Sbreak;* L6 g9 x9 [# j: i) `
case 'select':- b! p6 V5 g7 M) D
?>4 ?5 T. B# p$ {8 Y- A7 v" h
0 X$ ?. u* |+ F) N2 \<div class="description"><?php echo $value['name']; ?></div>9 H1 J" P* Q; D& T
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
+ G/ Y$ e8 M" m% j<?php foreach ($value['options'] as $option) { ?>
V0 K9 ^4 E1 {- P, v7 ^<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
6 ~% j& S* r! D! [5 a1 Z<?php } ?>
+ F3 T" w5 Y0 I( l2 [; g</select> K/ y7 `% l" c) ~5 F) P
</p>7 y! V, p) T2 ^( Z( u
) K% R8 i$ b" P3 t k% ~
<?php
9 ~6 q' u1 M; z6 w; Xbreak;
0 F) i ?* z9 h7 t6 E8 ^' ^case 'textarea':
0 r# F; x$ k% W$ ^+ ]$ f$valuex = $value['id'];* v0 E2 g( a4 s1 P8 H& ^0 \
$valuey = stripslashes($valuex);" j: `; l8 c& \5 R) `9 D
$video_code = get_settings($valuey);& V% ]3 |. k* N4 x+ i3 s [
?>
0 J; f! V( {8 p& S6 h- [, V) h; U1 N+ Y
<div class="description"><?php echo $value['name']; ?></div> w) m# G: e, X* a
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
0 c. x9 Y, |& m% `8 S
% V4 N* h, P: H) ^2 f6 Telse { echo $value['std']; } ?></textarea></p>7 e. E; ^. {3 O1 {; Y
2 [/ {5 b9 a7 n' b \" n" S
<?php
2 Q% F, b0 }# K* F& ?; Gbreak;/ S3 m1 Z0 m v3 M% V: E
case 'close':# ^ h/ ^& R { a0 \3 p0 h6 e
?>- ]9 `) U& X3 g3 }% R- c: m- n
+ e) Z3 W" k+ n7 j' j* J<div class="clearfix"></div>
5 O% [6 i7 w& m& t. |; m$ r6 R% {</div><!-- OPTION SAVE END -->
+ b3 }( v% j- ~6 D0 i! Q' c# F
6 u2 U# f& m l8 r3 u" o4 A<div class="clearfix"></div>
' K r% e, n- o1 a) H) l</div><!-- GET OPTION END -->* W$ @+ l( X: \) L
5 ?% P- X0 i: \1 e: `<?php
, Z- Y% k% j5 Rbreak;
' Q7 v$ l; Y# r4 P1 t6 T* Fdefault;. r9 \1 U3 T% K
?>- b M$ u9 J7 @- D" X
) C2 _/ }) w+ x' r- W0 U, z
! j4 m$ S' J6 \% {4 r2 X8 t<?php1 k0 B/ L+ R. m% e4 B
break; } ?>
5 Y6 H+ o/ V- Q* c3 q+ t0 a2 G9 V) v& [( S
<?php } ?>
) _: I4 a8 V' _5 M. H3 B* _& F. C6 s' h# x- g: X6 [8 t$ s
<p class="save-p">) _2 c" p. N; x3 h. l* H. q) H
<input name="save" type="submit" class="sbutton" value="Save Options" />
" \, X5 z& N8 y$ @. o<input type="hidden" name="action" value="save" />
( O) T) m; h/ Q</p># Q+ j9 B4 ]1 i6 Q1 f5 K1 ]( b
</form>
. j8 ?: S8 C O: K- C
, r0 j+ g! Y* G4 m<form method="post">: ?( I. B1 M4 U7 `4 r
<p class="save-p">: _6 n$ V" L5 D4 f+ b7 ?, V5 v
<input name="reset" type="submit" class="sbutton" value="Reset Options" />: z3 G/ \ l2 M1 |: K' G
<input type="hidden" name="action" value="reset" />' {" Y/ p1 v4 j
</p>
2 k( u! W) I5 d" u3 l</form># Y* ]2 f) w! z
/ ` a2 D0 P Y+ g# a
</div><!-- ADMIN OPTIONS END -->
: t ~/ c2 y" R
) @7 a5 y7 t. v& W<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }" X2 i, _- E6 ?* c, ]
" p7 H, e/ m- T& |3 l* g
function mytheme_admin_register() {' N4 C# d7 e1 y7 `& k$ k
global $themename, $shortname, $options;
) \" W! j. G Mif ( $_GET['page'] == basename(__FILE__) ) {
0 j- J; p8 U* Qif ( 'save' == $_REQUEST['action'] ) {7 l( {' M9 P( F! `; r
foreach ($options as $value) {
" M/ R0 r3 \$ K! t/ h$ F- wupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }. A+ q; w/ u3 U2 D, T# k1 k
foreach ($options as $value) {
* m) ]5 K2 s) H. I+ sif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }4 N6 y7 K2 q9 r
header("Location: themes.php?page=functions.php&saved=true");5 E8 {( L: S' ~/ s$ C8 _$ U7 c; S
die;
0 N' A5 ?* D5 X} else if( 'reset' == $_REQUEST['action'] ) {
- k5 c) E( n, ]- Iforeach ($options as $value) {1 o& ^, p2 p$ ?- d# X4 ^ y
delete_option( $value['id'] ); }
% |1 t$ r* A' \# s) A* B1 o+ cheader("Location: themes.php?page=functions.php&reset=true");
* R# P9 m) S- P9 u4 {$ I1 ddie;
. D J/ K$ K7 g1 P1 ?8 l3 H3 x" o}
! J' M2 i$ W9 M+ h}
9 F, P/ j4 k1 o% ^add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
; M/ a. v: ?2 T% i}
# n9 r# J( j" r
' p5 i3 N9 J7 e. h, ufunction mytheme_admin_head() { ?>
. p: ?) [+ n. P5 U<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />' h$ Y- ~: U$ w6 b1 ^# U9 Y4 Y
<?php }# u# c! q; Z' @' @/ k( Q! h
|
|