|
|

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