|
|

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