|
|

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