|
|

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