|
|

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