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