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