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