|
|

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