|
|

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