|
|

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