|
|

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