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