|

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