|
|

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