|
|

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